ctrl+scroll always zooms to top left corner

Bug #1958585 reported by Jan Willem
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Pinta
In Progress
Medium
Unassigned

Bug Description

When scrolling using the ctrl-key and scroll wheel combination the canvas is not focusing on the mouse position. Instead it slowly moves to the top left corner with every increase in zoom level.
It would be preferable to zoom and keep the center of the screen with respect of the mouse position, because this is an easy way to zoom into to a specific location. Also with the current behavior if you zoom in it feels very random where in the canvas you end up.

To summarize:
Currently zooming using the scroll wheel results in a random feeling location.
It would be awesome if the scroll wheel could be used to zoom into a specif location on the canvas pointed by the mouse pointer. '

Tested on the release 2.0.2 and the latest build https://github.com/PintaProject/Pinta/commit/4cbb314fbcf26c594717ee2f43c3d7208e41b3b4

Tags: sroll zoom
Revision history for this message
Jan Willem (jaques98) wrote :
Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks for the report! I agree that the behaviour should be as you're describing

The code is making some attempt to recenter the view, so I'll have to do some testing with a mouse and look into this. I see one related change in Pinta 2.0 to get Ctrl+wheel working after porting to GTK3 (https://github.com/PintaProject/Pinta/pull/177), so testing against Pinta 1.7 is probably the first place to start

Changed in pinta:
importance: Undecided → Medium
milestone: none → 2.1
status: New → Confirmed
Revision history for this message
Cameron White (cameronwhite91) wrote :

I've done some work on this in the https://github.com/PintaProject/Pinta/tree/fix/zoom-scroll-wheel branch - testing would be appreciated!

Changed in pinta:
status: Confirmed → In Progress
Revision history for this message
Cameron White (cameronwhite91) wrote :

Doing some more testing on a setup with a proper mouse, the zoom tool is working as I'd expect now (click to zoom in/out stays centred around the point that was clicked), but Ctrl+scroll is a bit off - it kind of looks as though there is some extra scrolling as if the Ctrl was ignored and a normal scroll happened.

Revision history for this message
Jan Willem (jaques98) wrote :

Yes the click to zoom seems to work better now! Especially on the higher zoom levels. But on lower zoom levels when the canvas still fits on the screen it seems to jump around. I think (My best guess but sill a guess) this could be because the canvas cannot be moved if it fits on the screen.
Many other drawing applications allow for the canvas to be moved even if it fits on the screen (Inkscape and Paint.NET comes to mind as quick examples).

I will add two video's below to demonstrate the different behaviors and the ability to scroll a canvas that fits on the screen.

Revision history for this message
Jan Willem (jaques98) wrote :

This is how Paint.NET handles zooming

Revision history for this message
Jan Willem (jaques98) wrote :

This is the current scrolling behavior in the fix/zoom-scroll-wheel branch. Showing that the click to zoom still jumps on lower zoom levels.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks for the testing! Yeah, I also suspect that the inability to scroll is at least partially to blame for those issues

Revision history for this message
Nico (nicohood) wrote :

Hi!
I was about to report the exact same bug. Super annoying, as the whole view jumps to the left. Would be nice if that can be fixed.

Workaround: Use the plus button to zoom

Changed in pinta:
milestone: 2.1 → 2.2
Revision history for this message
Tyler Walker (roodoo17) wrote :

This will be fixed in 2.2? Looking forward to it man. Pinta has alot of potential to be a superior and FOSS Paint.NET

Revision history for this message
Cameron White (cameronwhite91) wrote :

It's currently on the plan for 2.2, yes
There's also an in-progress port to GTK4, so that may turn into the 2.2 release instead depending on how that progresses

Revision history for this message
Cameron White (cameronwhite91) wrote :

The zoom-scroll-wheel branch has been merged (https://github.com/PintaProject/Pinta/commit/32f298e380787dbc81885ea73ab5b058f3a3bbca) with some fixes to be compatible with the GTK4 port

I think the remaining issue is just the jumping around at lower zoom levels because the canvas cannot scroll to stay centered around the zoom point

Revision history for this message
Jan Willem (jaques98) wrote :

Thanks for the contentious support on this issue and working on the GTK4 port! I build https://github.com/PintaProject/Pinta/commit/548c3c8f7a652c2c141fbe0d3fd9043b531e0a36 and unfortunately it looks like the issue is still there for high zoom levels. When ctrl+scrolling the canvas is still moved to the left corner.

Revision history for this message
Jan Willem (jaques98) wrote :

A demo for visualizing the behavior in for the newest build

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks! I think I had been doing more testing with the zoom tool which is working better, so there is a difference there to investigate

Changed in pinta:
milestone: 2.2 → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.