Skip to content

Fix overlay scrollbar intercepting clicks on selection handles at image edges (#2200)#2201

Merged
cameronwhite merged 2 commits into
PintaProject:masterfrom
AoMas17:master
Jun 30, 2026
Merged

Fix overlay scrollbar intercepting clicks on selection handles at image edges (#2200)#2201
cameronwhite merged 2 commits into
PintaProject:masterfrom
AoMas17:master

Conversation

@AoMas17

@AoMas17 AoMas17 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2200 by preventing overlay scrollbars from capturing pointer events when the current tool is interacting with a selection resize handle near the canvas edge.

When a rectangle or ellipse selection reaches the image boundary and the canvas is zoomed in enough for scrollbars to appear, the scrollbar can overlap the resize handle and block interaction. With this change, the selection tool temporarily keeps the scrollbar from targeting pointer events while the cursor is over an active handle, so the handle remains draggable as expected.

I also attached a before/after video showing the problem and the fix in action.

This is my first contribution to Pinta, so I'm not yet familiar with the project's roadmap or preferred development practices. I'm very open to feedback and happy to rework any part of this PR if needed.

before.mp4
after.mp4

@cameronwhite

Copy link
Copy Markdown
Member

Thanks for looking into this!

I think the approach here is good; my suggestion would be to generalize it a bit further so that tools don't need to explicitly be aware of and opt into this. For example, the gradient tool also has handles for adjusting the gradient start/end position which shouldn't be blocked by scrollbars

One thought would be to avoid the new virtual method and instead check if any of the tool.Handles are active and underneath the point. This would be adding a new virtual on IToolHandle instead (basically the same as the ContainsPoint() function that some handle implementations already have), but I think that would be better in the long run since handles are reused across various tools

@AoMas17

AoMas17 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I've reworked the PR along those lines.

Instead of the BlocksOverlayScrollbars virtual on BaseTool that each tool had to opt into, I added a ContainsPoint(PointD windowPoint) member to IToolHandle.

CanvasWindow now just checks whether any of the current tool's Handles are active and under the cursor, rather than asking the tool directly.

MoveHandle already had the geometry, so RectangleHandle and LineHandle just delegate to their child handles. Tools no longer need to know about scrollbars, and any tool with handles is covered automatically, so the gradient tool's start/end handles now work too.

@cameronwhite

Copy link
Copy Markdown
Member

The changes look good - thanks!

@cameronwhite cameronwhite merged commit a9d5c27 into PintaProject:master Jun 30, 2026
6 checks passed
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.

Overlay scrollbar intercepts clicks on selection handles at image edges when zoomed in

2 participants