This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
forked from trelby/trelby
-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By putting the Control into a ScrolledWindow, we get scroll bars whenever the Control's container is smaller than its minimum size. Vertical scrolling of the ScrolledWindow currently is deactivated, as we still have our custom implementation for vertical scrolling. This, however, raises some issues: At first, the vertical scroll bar gets scrolled away along with the Screenplay Control while scrolling horizontally, as it is part of the contents of the ScrolledWindow. Also, the hand-made scrollbar lacks some features, such as auto-hiding or the "precise scrolling mode" on Gtk. Eventually, the custom scrolling implementation is probably going to get in our way when implementing limburgher#20 anyway, so we should try to port vertical scrolling to the ScrolledWindow scrolling mechanism.
Before this commit, horizontal scrolling also moves the vertical scroll bar.
I specifically implemented fd5c593 to make this comment not necessary
Using a GraphicsContext, drawings can be scaled using wxWidgets. But attention: Logic that changes the layout based on certain pixel constants might still use the old constants. Click events on the canvas don't respect the scale factor yet. And there is still a bug that text is not aligned correctly.
Before this commit, the horizontal scrollbar wouldn't appear when the page was too wide because it was zoomed.
When calculating layout, we don't take zoom into account – instead, the zoom later gets added to the values that our layout code calculates. When taking the available size into account, our layout code used the `GetClientSize` method of `MyCtrl`, which offered the real size of the rendered widget, which corresponds to the sizes *after* the zoom has been taken into account. This caused things like the page not being centered when zoomed or the side-by-side layout mode refusing to show more pages when zooming out. This commit introduces the `GetLogicalClientSize` method, which translates the actual client size to one that can be used when calculating the layout.
It's actually a DrawingContext drawing to a GraphicsContext
Please close this PR and reopen again https://github.com/trelby/trelby, as the project is merging into that project. Thank you! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 ready, this fixes #20.
TODO
graphicsContext
=>drawingContext
(ordc
)