Correct mapping of tracker size for FlyoutPaletteComposite movement #882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When dragging a flyout palette, a tracker on the Display is instantiated to show a preview of the drag result. When different zooms are involved (such as when using Draw2d autoscaling for the monitor-specific scaling capability on Windows), the tracker preview has a wrong size on non-100% monitors. This is caused by multiple Display#map() methods being applied on the same rectangle, which leads to the zoom being applied multiple times.
This change adapts the preview size calculation to prevent that the map operation (and thus the zoom) is not applied multiple times to the width and height of the preview rectangle. The change is backward compatible as without monitor-specific scaling capabilities and Draw2d autoscaling there are no zoom transformations involved, which is why the multiple map operations applied did not lead to any issues.
Fixes #868
For the tracker preview to work properly, a recent SWT state is also required, as an SWT fix is also necessary to make the tracker work properly:
This supercedes and thus closes ##869
It is less invasive and thus better preserves existing behavior and reduces the risk of regressions.
Before
After