Bug 329959

Summary: JJ: Simple Pan Zoom functionality for overview docker
Product: [Applications] krita Reporter: Bollebib <kwadraatnope>
Component: DockersAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: dimula73, eduardelriceam, esdouzewa, ghevan, halla, kahncub, sven.langkamp
Priority: NOR Keywords: junior-jobs
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Bollebib 2014-01-14 16:03:32 UTC
see title + irc paste

Zoom and pan on overview docker
preferably mimick zoom and pan options the user has set up for mouse and stylus.
otherwise use default krita shorcuts with stylus or mouse



16:38:57 - Bollebib1: dmitryK, boud: how feasable and/or timeconsuming would it be to add zoom and pan functionality to the overview docker?
16:39:45 - Bollebib1: (preferably with keyboard or stylus shorctus,no scrollbars or other such stuff )
16:42:58 - dmitryK: Bollebib: if without connection to the global hotkeys system, then a day or two. If we want it to get configuration from the global shortcuts configuration (which, i guess, is a preferrable thing), then it might take a week or something.
16:43:56 - Bollebib1: dmitryK: mmmh,can't it just reuse the hotkeys you already have for zooming and such?
16:44:32 - Bollebib1: or can the docker not detect when stuff is hovering over it?
16:45:28 - Bollebib1:  mmmh,no a docker can do that
16:45:28 - Bollebib1: the color selecto gives me feedback,so potentially it should be possible...,no?
16:45:35 - dmitryK: Bollebib: it's a separate filtering system that handles the gestures right now. If we want to use it in the overview docker and in the scratchpad, then we'll need to generalize it a bit.
16:46:32 - Bollebib1: k
16:46:32 - Bollebib1: guess I'll just file a wishbug for it with an IRC paste of this conversation
16:46:35 - dmitryK: Bollebib: If you want your custom Ctrl+Alt+Space gestures to work in the overview docker than quite a lot of work is needed.
16:47:25 - Bollebib1: no just MMB en RMB shorcuts would be fine,maybe mousewheel as well,stuff like that
16:47:25 - Bollebib1: but that's just me
16:47:44 - dmitryK: Bollebib: if it is enough to connect it to mouse button and mouse wheel, then it is not much of work. But we should think well how the tablet stylus users would use it
16:49:05 - Bollebib1: My thoughts are now you can't do anything with it
16:49:05 - Bollebib1: if you could pan and zoom with stylus or mouse at least it will become instantly much more useful
16:49:54 - Bollebib1: dmitryK: how dyou mean?
16:49:54 - Bollebib1: workflow?
16:51:29 - Bollebib1: dmitryK: would it detect stylus plus shift or CTRL combinations? for people who have zoom on that?
16:52:43 - dmitryK: Bollebib: yes, just we need that these combinations are quite obvious, because we cannot make a configuration for them easily
16:54:46 - Bollebib1: dmitryK: well you could ofcourse
16:54:46 - Bollebib1: if no zoom or pan is present on stylus/mouse combinations (which would be strange ,but possible)
16:54:46 - Bollebib1: make the docker use krita default zoom and pan shortcuts,in the short term...?
16:55:00 - Bollebib1: which would be MMB and shift+MMB?
16:55:48 - Bollebib1: you can't do any other operation on that docker so it would not conflict with anything else I don't think...But i might be oversimplifying and not see the difficulty
16:56:05 - Bollebib1: still,it would be much more useful then nothing,as it is now
16:58:03 - Bollebib1: I guess I'll just at this as a wishbug with this IRC paste
16:58:03 - Bollebib1: it's not urgent,but in the past i could have used this countless times to help with sketching
16:58:09 - Bollebib1: *add this
16:58:44 - Bollebib1: and I encountered it again just now,and seems useful enough for a lot of people,I imagine
16:58:48 - rsek has left the room (Quit: Konversation terminated!).
16:59:11 - dmitryK: Bollebib: ok, make a report then
Comment 1 Halla Rempt 2014-01-14 18:12:47 UTC
Yea, this has been a TODO for me for ages.

The problem is that current overview docker does what I needed it to do for me when I started on it :-) And that spare time is hard to come by.
Comment 2 Eiko Yumi 2014-01-21 23:04:06 UTC
I would also add the following improvements:

- Change scaling to bi or trilinear to improve visual quality and clarity. The overview docker currently shows a hardly usable, aliased mess on large canvases.

- Make the scaled canvas shown inside the overview docker clickable. Clicking any part of it would change the current canvas view to the click area. Click-dragging should be supported, and would work similarly to the spacebar or middle click pan. This would be useful make navigating large canvases when working at 100% zoom much easier.

- Inside the overview docker, add a box representing the current canvas in the viewport. This would make further clear which area of the entire canvas one is working on. The box would have exactly the same proportions of the visible canvas in the Krita program window.

- When showing the entire canvas, the overview docker would work like similar ones in commercial drawing/painting programs such as MangaStudio, OpenCanvas, PaintTool SAI. The docker could optionally be set up to show a zoomed view (100% or 200% zoom) following the cursor in real time. In this way it would work like the "Magnifier" widget in OpenCanvas which allows to draw/write with great precision even at low zoom settings.
Comment 3 Halla Rempt 2014-02-13 15:57:00 UTC
*** Bug 331096 has been marked as a duplicate of this bug. ***
Comment 4 vanyossi 2014-02-13 20:42:54 UTC
Dropping another idea.

The overview could also show the current canvas rotation state. It could have a little compass ring with an arrow showing the canvas current north at the bottom right, that also could be used to rotate if click and drag and reset rotation if click at the centre of it.

Or maybe the small box representing canvas viewport could be represented rotated with an arrow pointing to the document's north.
Comment 5 Halla Rempt 2014-05-21 09:22:37 UTC
*** Bug 330628 has been marked as a duplicate of this bug. ***
Comment 6 Sven Langkamp 2014-09-07 01:48:18 UTC
Forgot to CC the bug. I just added the pan and zoom functionality to the overview docker.
Comment 7 Sven Langkamp 2014-09-07 11:44:18 UTC
Git commit b99cb3fe1cab063da0202b9e6fe943b3936ab323 by Sven Langkamp.
Committed on 07/09/2014 at 11:40.
Pushed by langkamp into branch 'master'.

make sure that the events are accepted and dragging in the overview docker doesn't sometimes move the application

M  +3    -6    krita/plugins/extensions/dockers/overview/overviewwidget.cc

http://commits.kde.org/calligra/b99cb3fe1cab063da0202b9e6fe943b3936ab323
Comment 8 Bollebib 2014-09-08 12:19:37 UTC
great additions sven,it's already much better

I do have a few questions

1) is it possible to enable shortcuts that the user has configured for zoom and pan on canvas? (like MMB+drag and RMB+drag) That makes it much more natural and predictable.

2)could there be an option to keep the red rectangle in focus so that you actually zoom into the image, without actually zooming in on the canvas? That's what I originally asked for,but now I see that the overview could also be used for what you implemented.

I'm not sure how to go from here,or if it would be better to keep this as is,and use this idea to improve the reference docker ,so that it can also show the current document (like the overview,in realtime) but with better zoom and pan control (those buttons and workflow are not ideal)



Let me know what you think
Comment 9 Sven Langkamp 2014-09-08 17:35:28 UTC
1) I guess it would be possible if we map all the input onto the big canvas. Might be even able to paint from the docker ;). On the other hand I think it's good if the overview dockers is decoupled from the canvas input handling e.g. it's possible to use click+drag for pan while that's not possible on the canvas. Also other applications like Gimp show the same behavior.

2) I don't understand what you mean.
Comment 10 Bollebib 2014-09-09 09:31:29 UTC
1) my reason for this is to not need another way of working. I find it annoying that I just can't mimick what I do on a canvas,it's natural. Any other way is also not ideal for a setup. If I need a mouse ,I need to grab my mouse,which interupts my flow. etc...

I'm not saying you need to get rid of mouse scroll to zoom in,that is great for people who want it. But any way you will provide will inherently be slower then what people have already configured and are used to on a canvas-like surface. Muscle memory trumps all other considerations,imo.

You mention painting inside a docker but it's precisely what I ask in this wish https://bugs.kde.org/show_bug.cgi?id=338096   

Reference docker already has click+drag but that is annoying. You can only drag to zoom in,and then you have to press an awkward button to zoom out. It's very slow,very tedious ,so I would advise against this. It's one of the reasons I don't want to work with the Reference docker because it feels unnatural to me. 

1b) Additionally maybe overview should also have + and - button onderneath the overview to zoom in and out, and 1:1 button and "show all" button.


2) I was asking if it was possible for the reference docker to have the current image,open in krita as an image. The overview is nice but for big images it's unreadable. And when you zoom in,you use the red rectangle which is good for an overview. But it would be nice to be able to look at your current image,in realtime, as a reference. 


For example: in top left corner of your workimage/drawing there is a fly. In the  bottom right corner you want to draw a similar fly. The original fly is very small. If you can zoom in to that fly,and use this in a docker as a reference to draw the second fly that would be great. If you want to do this currently you need to save the image,then open it in reference docker to see it.

=>it would be better if you could just have "current image" option in reference docker.

Then it would work like overview (realtime,current image) but you can actually zoom in. With overview you can't use the current image as it's own reference to keep an eye on certain details.

2b) Alternatively this can also be done with the overview if there is a button to toggle between 
I -  the red rectangle
II - the contents of the rectangle

II would be the actual zoom.





is this more clear?
Comment 11 Bollebib 2014-09-09 09:39:21 UTC
SHORT version


1) Current way overview zoom (mouse) is fine,but extra option to work as a person is used to would be appreciated. Just mimick the canvas because of muscle memory.
1b) maybe extra buttons under the overview would be good (like gimp) (zoom, 1:1 , ALL)


2)Improve "reference docker" to have "overview docker"-like functionality (realtime image)

or 

2b) Improve "Overview Docker" to have "reference docker"-like functionality (actual zoom in,no rectangle)
Comment 12 Sven Langkamp 2014-09-14 13:35:08 UTC
Git commit 2ea1cabe79b9888a58b4e850cbaa0875a91f8ef3 by Sven Langkamp.
Committed on 14/09/2014 at 13:22.
Pushed by langkamp into branch 'master'.

Allow to have more than one zoom widget, also add an additional zoom widget to the Krita overview docker

M  +7    -3    krita/plugins/extensions/dockers/overview/overviewdocker_dock.cpp
M  +2    -0    krita/plugins/extensions/dockers/overview/overviewdocker_dock.h
M  +1    -1    libs/widgets/CMakeLists.txt
M  +28   -101  libs/widgets/KoZoomAction.cpp
M  +5    -0    libs/widgets/KoZoomAction.h
A  +134  -0    libs/widgets/KoZoomWidget.cpp     [License: LGPL (v2)]
A  +82   -0    libs/widgets/KoZoomWidget.h     [License: LGPL (v2)]

http://commits.kde.org/calligra/2ea1cabe79b9888a58b4e850cbaa0875a91f8ef3
Comment 13 Dmitry Kazakov 2014-09-15 04:56:00 UTC
Btw, it might also be a good idea to ensure that the borders of the red rectangle never disappear when the rect goes out of the widget

Here is what we have now:
http://pbrd.co/1qPElsC

It is quite perplexing for a user when he sees only one or two lines of the rectangle.
Comment 14 Halla Rempt 2014-09-19 08:15:27 UTC
Hm, yes, I agree with Dmitry. That would be good to have. The scaling quality of the thumbnail also needs a bit of improvement. The panning is a bit weird when you have canvas mirroring on, too :-)
Comment 15 Sven Langkamp 2014-09-19 14:16:01 UTC
Showing the borders inside the widget is wrong as the real border is outside of the image and that would give a wrong indication. Might be solved by drawing the outside of the rectangle darker.

Due to the fact that the image is shown untransformed in the docker some operations like rotation and panning when mirrored look a weird. It would be possible to reverse that effect, but then you have the image rotating in weird ways around the rectangle ;)
Comment 16 Bollebib 2014-11-17 14:58:16 UTC
I have seen that out of bounds zooming is now solved with a striped line which works great!

Overview still perhaps needs a way to toggle between rectangle mode (current implementation) and zoom mode that provides a way to look,zoom and pan the image and use it as a quickreference so you can focus on something that is out of the canvas scope.