Closed manufino closed 2 months ago
@DarwinNE, could you explain more clearly how you'd like this to be implemented?
If we move this logic into the movement process, it becomes very heavy because it would constantly have to check that all vertices of all selected primitives are normalized. With many primitives selected, this would almost certainly result in lag during movement.
It is possible, but IIRC by far the most time critical operation is the redraw. Each time you move something, part of the drawing has to be redrawn (*). As long as the normalizeCoordinates() just checks the selected primitives, it will introduce a negligible lag. In any case, there is a timer integrated in FidoCadJ to check the effect of such things, I think I mostly used checking the redraw speed, but I think it was useful also when moving objects on the screen.
(*) the fact that FidoCadJ redraws much more than FidoCAD (with double buffering) is due to the fact that we can not use the XOR toggle technique that was possible (and common) at the time of FidoCAD. Unfortunately, the XOR technique does not work well with the anti-aliasing.
I understand, I'll try to implement something efficient during the movement phase.
The problem still remains with existing drawings. Do you think we should apply normalizeCoordinates()
when opening a file as well?
I think it may be a good idea, maybe asking to the user what they want to do. What do you think about it?
Great, let's proceed that way then.
@DarwinNE, , I think this should be fine.
@DarwinNE, while doing some debugging, I traced the issue to this line.
In the checkKey()
, "md.filename" should be compared, not "md.library".
Great stuff. I changed "primitives" into "elements" in some contexts, as it is more general. After all, a macro can be outside of the drawing area, too.
And #219 can also be closed.