Discussion:
Set-coords arc floating precision
Nate Chodosh
2015-10-03 00:55:17 UTC
Permalink
Hello,

My name is Nate. I have never participated in one of these lists before so
I don't know the protocol so I apologize if this isn't the appropriate
channel.

I am working on an application where I need arrows on the end of arcs,
which I am accomplishing by adding very small lines to the end points.
However I think I have discovered that set-coords when used with an arc
won't update the position unless the coordinates are integers which makes
my approach impossible. Is there a workaround for this issue?

Thank you,
Nate
cage
2015-10-04 09:23:57 UTC
Permalink
Post by Nate Chodosh
Hello,
Hello!
Post by Nate Chodosh
My name is Nate. I have never participated in one of these lists before so
I don't know the protocol so I apologize if this isn't the appropriate
channel.
No problem! Welcome! :)
Post by Nate Chodosh
I am working on an application where I need arrows on the end of arcs,
which I am accomplishing by adding very small lines to the end points.
However I think I have discovered that set-coords when used with an arc
won't update the position unless the coordinates are integers which makes
my approach impossible. Is there a workaround for this issue?
No sure I can see the point here as you did not provided any code but
if you are rendering on the screen, as I guess, you will have to deal
with rounding anyway: if you want to draw at x = 1.5 (for example) you
have to decide which pixel draw (x = 1 or x = 2) as there is "nothing"
between pixel.
Post by Nate Chodosh
Thank you,
Nate
Bye!
C.
Nate Chodosh
2015-10-04 18:19:38 UTC
Permalink
Thanks for the welcome!

Right, I know that rounding has to occur eventually but if I extend my line
ltk seems to be able to draw an arrow head that looks rotated to a
precision greater than the 45 degree increments allowed by a single pixel
long line. So I'm wondering if it's possible to get that precision without
the long "tail" on the arrow. Googling has turned up this
<http://www.perlmonks.org/?node_id=800025> which seems to indicate that my
idea would work directly in tk so does ltk perform the rounding earlier?

Thanks,
Nate
Post by cage
Post by Nate Chodosh
Hello,
Hello!
Post by Nate Chodosh
My name is Nate. I have never participated in one of these lists before
so
Post by Nate Chodosh
I don't know the protocol so I apologize if this isn't the appropriate
channel.
No problem! Welcome! :)
Post by Nate Chodosh
I am working on an application where I need arrows on the end of arcs,
which I am accomplishing by adding very small lines to the end points.
However I think I have discovered that set-coords when used with an arc
won't update the position unless the coordinates are integers which makes
my approach impossible. Is there a workaround for this issue?
No sure I can see the point here as you did not provided any code but
if you are rendering on the screen, as I guess, you will have to deal
with rounding anyway: if you want to draw at x = 1.5 (for example) you
have to decide which pixel draw (x = 1 or x = 2) as there is "nothing"
between pixel.
Post by Nate Chodosh
Thank you,
Nate
Bye!
C.
Loading...