Closed perazz closed 2 weeks ago
I have a question.
Let's say I have a circle centered at (0.5, 0.5) with a radius of 0.25. I would assume that the radius would also be between 0 and 1.
But how would it be translated to, for example, an 800600 canvas? I don't think it really makes sense for the circle to become an ellipse. Should it translate like this: Radius: 0.25 (800+600)/2 = 175 pixels, or is there a better way?
You may want to have distinction between size and position.
So I should leave all size units as pixels?
You may want to support 3 different sizes (one with multiple units):
Note that the conversions between any of them depend on how the size and resolution of the drawing is specified
This issue wants to support the discussion of how to design a unique coordinate space @AnonMiraj @johandweber @everythingfunctional.
One option could be to have one class that describes coordinates in the drawing space:
All (x,y) coordinates in the drawing space that appear on the canvas would be of
type(point)
and in range betweenpoint(0,0)
andpoint(1,1)
.The canvas would instead be described by image coordinates (pixels):
A
type(canvas_size) :: size
variable would be included in every canvas.A linear mapping can describe the relationship between
point
andcanvas_point
: something like