Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Draw2D Cursors class as deprecated and for-removal #481

Closed
wants to merge 1 commit into from

Conversation

ptziegler
Copy link
Contributor

Using static cursors is fundamentally flawed when considering dynamic DPI changes. The static cursors created by this class are created with respect to the current display zoom. Those objects are not updated, should this value change at a later time. Clients need to listen to the SWT.ZoomChanged event and update their cursors via the CursorProvider interface.

@ptziegler
Copy link
Contributor Author

As discussed in #479: The static Cursor objects don't support dynamic DPI changes. Meaning those instances keep using the initial display zoom, even though the level has already been changed.

This is effectively just an experiment where I mark the Cursors class as deprecated and update all references with a "CursorProvider", i.e. an interface that is supposed to always return a cursor that matches the current display zoom.

But even now this is already becoming a mess, as it requires changes to both the Draw2D figures and GEF tools. @azoitl wdyt?

Using static cursors is fundamentally flawed when considering dynamic
DPI changes. The static cursors created by this class are created with
respect to the current display zoom. Those objects are not updated,
should this value change at a later time. Clients need to listen to the
SWT.ZoomChanged event and update their cursors via the CursorProvider
interface.
@ptziegler
Copy link
Contributor Author

Alternatively, we could also keep this CursorProvider purely internal and push the responsibility of updating the cursor to the client.

@ptziegler
Copy link
Contributor Author

A misunderstanding on my side... The native cursors are updated upon DPI changes, but not the shared cursors.

@ptziegler ptziegler closed this Jul 22, 2024
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.

1 participant