-
Notifications
You must be signed in to change notification settings - Fork 187
[GTK] Factor out common image initialization functionality #1892
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
[GTK] Factor out common image initialization functionality #1892
Conversation
2dcd231 to
a5dbf87
Compare
|
@akoch-yatta May I ask you to also have a look at this change? It is quite similar to the Windows one from last week, except for the GTK implementation still being tied to a single handle (thus destroying handles upon zoom changes). I have already tested the change on a Linux system with different and changing monitor zoom values, so it's primarily about checking soundness and correctness for the code. |
akoch-yatta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the one remark, this change looks good to me
| } | ||
| if (this.surface == 0) { | ||
| ImageData imageData = new ImageData(fileForZoom.element()); | ||
| if (fileForZoom.zoom() == zoom) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That must be an !=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you! That was part of a final small refactoring after the lastest test. Always good to check again afterwards...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that situation 😄 PR looks good to me now
01ae47e to
0a1f0c4
Compare
The GTK implementation of the Image class currently contains the basically same piece of code for initializing and image based on an ImageFileNameProvider and ImageDataProvider twice, once in the Image constructors and once in the refresh logic for changing the zoom. This change factors out the common functionality in reused methods and streamlines the implementation for the ImageFileNameProvider.
0a1f0c4 to
dc5cebc
Compare
The GTK implementation of the Image class currently contains the basically same piece of code for initializing and image based on an ImageFileNameProvider and ImageDataProvider twice, once in the Image constructors and once in the refresh logic for changing the zoom.
This change factors out the common functionality in reused methods and streamlines the implementation for the ImageFileNameProvider.
This serves as a preparation for:
Unifies the GTK with the Windows implementation as adapted in: