Only use double-precision translation when HighDPI scaling is enabled
When the "draw2d.enableAutoscale" system property is enabled, additional (scalable) layers are injected into the IFigure hierarchy to take the monitor zoom into consideration.
As a result of this, translating geometric shapes may cause additional rounding errors, which are the result of translating integer-values with an additional, fractional zoom level.
To work around this problem, the "useDoublePrecision()" method was added with 5cfe5b7587123e68c2077b6dbec4e5657316d458, which converts the geometric shapes to their precise variants. This conversion is generally not backwards compatible.
To make sure clients can fully opt-out of this new behavior, this conversion should only be done when the "draw2d.enableAutoscale" is set to true, meaning only when these new layers are added, that require this extended translation logic.
@azoitl As said in https://github.com/eclipse-gef/gef-classic/issues/772#issuecomment-3553126952, I'm really concerned about the current state of the HiDPI integration in GEF, so far into the release. And would really like to be able to restore the previous behavior with the switch of a flag. wdyt?
@ptziegler I have to admit that I lost track about the state. There was so much discussion and I had way to little time. But I have the same impression. If I understand your comment right we could per default turn the flag of for the 3.26 release and reconsider the decision during 3.27. This has the advantage that consumers like @HeikoKlare can already turn it on and other users are free to choose.
I think turning the flag on per default was very important we found many things that otherwise would not be detected. I also think we should try to get some fixes in during the RC phase. Especially if they are no breaking things for users that have the flag turned off.
I think turning the flag on per default was very important we found many things that otherwise would not be detected. I also think we should try to get some fixes in during the RC phase. Especially if they are no breaking things for users that have the flag turned off.
Now that I've calmed down a little, I think it's fine to keep it enabled for now. My biggest concern was #862, because it effectively blocks me from doing any additional tests. But if this issue is fixed now, I can continue with that tomorrow. I'd say if I don't find anything until the RC2, I'd keep the flag unchanged.
I'll like to keep this PR open until the M1, especially so that I can see whether the tests are still failing with #863.
@azoitl I'd like to also include this one in the 3.26.1. If there is anything else we've missed in the precision classes, it allows us to also turn off the "precise" translation. It also isn't needed for Linux/MacOS as there we don't have fractional scaling.