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

Update scrollbar after zoom on wxGTK #496

Merged

Conversation

tobiolo
Copy link
Collaborator

@tobiolo tobiolo commented Aug 27, 2023

No description provided.

@tobiolo tobiolo force-pushed the update-scrollbar-after-zoom-wxgtk branch 2 times, most recently from 9230409 to 42fb869 Compare August 27, 2023 09:51
@tobiolo tobiolo force-pushed the update-scrollbar-after-zoom-wxgtk branch from 42fb869 to ed8865c Compare August 27, 2023 09:55
@@ -745,6 +745,15 @@ struct Document {
#ifndef __WXMSW__
if (sw) sw->Refresh(false);
#endif
#ifdef __WXGTK__
if (sw) {
// wxWidgets (wxGTK) does not always automatically update the scrollbar
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls both the above Refresh and your new code GTK, are you sure both are needed?

Copy link
Collaborator Author

@tobiolo tobiolo Aug 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unfortunately. I tested it with a TreeSheets documents with nested grids and this is the way I found out to remove the bug that the scrollbar is at default position (0,0) when zoomed out instead of the correct scrollbar position mirroring the position of the selection on the canvas.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug demonstrated:

Peek.2023-08-27.17-50.mp4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR

Peek.2023-08-27.17-52.mp4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aardappel Do you agree with the rationale behind this PR?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

@aardappel aardappel merged commit 1a785ad into aardappel:master Aug 28, 2023
4 checks passed
@tobiolo tobiolo deleted the update-scrollbar-after-zoom-wxgtk branch August 29, 2023 05:18
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.

2 participants