Attach canvas event handlers to the parent widget#1929
Merged
Conversation
This fixes a regression from 079c086 where starting a drag outside the canvas was ignored. This happened because the new canvas widget configures the H/Valign properties to avoid expansion (simplifying a lot of other code), so the drag was outside the canvas widget itself - therefore, we need to attach it to a parent widget which contains the empty space. The changes are just relocating the gesture controllers, with a couple notes - We now need to translate the gesture coordinates to the canvas widget's space - The WindowMousePosition property is no longer needed since this was only for communicating between the two widgets The key press event handlers were also moved for consistency Fixes: #1908
This was a regression with the new canvas widget in Pinta 3.1
cameronwhite
added a commit
that referenced
this pull request
Jan 10, 2026
* Attach canvas event handlers to the outer grid. This fixes a regression from 079c086 where starting a drag outside the canvas was ignored. This happened because the new canvas widget configures the H/Valign properties to avoid expansion (simplifying a lot of other code), so the drag was outside the canvas widget itself - therefore, we need to attach it to a parent widget which contains the empty space. The changes are just relocating the gesture controllers, with a couple notes - We now need to translate the gesture coordinates to the canvas widget's space - The WindowMousePosition property is no longer needed since this was only for communicating between the two widgets The key press event handlers were also moved for consistency * Update the canvas position in the statusbar while dragging This was a regression with the new canvas widget in Pinta 3.1 Fixes: #1908 (cherry picked from commit fa6482f)
cameronwhite
added a commit
that referenced
this pull request
Jan 10, 2026
* Attach canvas event handlers to the outer grid. This fixes a regression from 079c086 where starting a drag outside the canvas was ignored. This happened because the new canvas widget configures the H/Valign properties to avoid expansion (simplifying a lot of other code), so the drag was outside the canvas widget itself - therefore, we need to attach it to a parent widget which contains the empty space. The changes are just relocating the gesture controllers, with a couple notes - We now need to translate the gesture coordinates to the canvas widget's space - The WindowMousePosition property is no longer needed since this was only for communicating between the two widgets The key press event handlers were also moved for consistency * Update the canvas position in the statusbar while dragging This was a regression with the new canvas widget in Pinta 3.1 Fixes: #1908 (cherry picked from commit fa6482f)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes a regression from 079c086 where starting a drag outside the canvas was ignored. This happened because the new canvas widget configures the H/Valign properties to avoid expansion (simplifying a lot of other code), so the drag was outside the canvas widget itself - therefore, we need to attach it to a parent widget which contains the empty space.
The changes are just relocating the gesture controllers, with a couple notes
The key press event handlers were also moved for consistency
Fixes: #1908