From: Dima K. <gn...@di...> - 2017-10-29 23:02:21
|
sfeam <sf...@us...> writes: >> I.e. we convert the vector start/end to integer terminal coords; short >> vectors become 0-vectors in this representation, so the >> terminal-specific arrow() function plots nothing. >> >> This is a bug: checking for a 0-vector should happen before we convert >> to integer pixel coordinates. > > I am not following the logic. > > If it is a 0-length vector then isn't it correct to not draw it? > Even if you keep the floating point representation for a bit longer, > at the time you convert to integer terminal coordinates it will > again become 0-length and thus not drawn. What am I missing? > > Is the idea that you want to draw an arrowhead even if the > shaft length is zero? Right. It's not actually a length-0 vector, but its length is < 1 pixel long. We should still draw an arrowhead, and the arrowhead should point in the correct direction. Once we convert to integers, then even if we wanted to draw something, we can't do it, since the direction has been lost. Here's a (hopefully convincing) thought: let's say you're looking at a plot of a vector field. Then you zoom out repeatedly. I would expect the plotted vector lengths to get shorted as you zoom out. The arrowheads maybe would get smaller too, depending on how they're plotted. But the transitions should be smooth. What currently happens is that as you zoom out, some subset of the vectors disappears. As you zoom out more, some OTHER subset disappears. This subset could be entirely different, and some vectors actually come back. Eventually they all disappear, but as they do so, sometimes they're plotted in an intermediate state where the arrowhead IS plotted, but its direction is completely wrong. Try with the example attached in the last email; use the mouse wheel to zoom out. |