I need to shrink a circle by its radius when it reaches the map borders, I implemented it.

It works well **left**, **top** and **bottom.**

Angles: (**PI**, **PI * 3 / 2**, **PI / 2**)

However, for the starting angle, which can be one of two options: **PI * 2** or **0**, it is not the radius that is shrinked, but the diameter, which greatly spoils the image.

How to fix this?

Top, left and bottom are all ok:

On the right are big problems: