Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Dec 4, 2025

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

flyout_tracker_broken

After

flyout_tracker_fixed

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 eclipse-gef#868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GEF: Offset when dragging flyout palette with different monitor zooms Offset when dragging flyout palette with different monitor zooms (Windows)

1 participant