I'm visualising a MASON network, using a SparseGrid2D for node positions as
My understanding has always been that the draw.width and draw.height fields
of the DrawInfo2D passed to an object for portrayal represent the unit width
and height in the "true" coordinate space (i.e., those you use when explicitly
drawing objects such as a Rectangle). As such, I'd expect these to be the
same for all drawn objects, since the grid sizing has to be consistent.
(To be clear, my nodes might be on a 100x100 grid. The draw.width field
represents the number of what-you-actually-draw x coordinate units
corresponding to 1 unit on the x axis of this grid.)
For the most part they are, and everything renders OK. However, on some
occasions, I get *different* unit widths or heights for different objects.
(Specifically, I had a different unit width (8.0) for the first node drawn,
compared to all the others (7.0).)
Is there any reason why this should be possible? These were definitely in the
same draw loop. Even if they weren't, it seems that the only thing that
changes these unit sizes is a rescale (window resize doesn't change them; it
only changes the viewable portion of the "canvas"), and a rescale should still
mean that they should always be in the same proportion to each other (which
wasn't the case here).
The code responsible is far too complex to post (but is just rendering nodes
and edges from a Network using custom portrayals, with nothing else
"clever"); if there are no known reasons why this should occur, I can try to
reproduce it using something more basic...