Selection dragging to window edges

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
CreativeWorld
Posts: 145
Joined: Fri Dec 30, 2011 7:08 pm

Selection dragging to window edges

Post by CreativeWorld »

The image pans strangely when a selection is drawn or dragged over the window edges.


Resize the xnview window so that there is room
for the mouse cursor to move around it.

Open a large image and zoom in to the center,
hold down the left mouse button,
and start drawing a selection,
move the cursor outside the xnview window.

Notice that if the cursor is above the top of the statusbar
(still outside the xnview window),
then the image starts scrolling up,

if the cursor is below the top of the
statusbar then the image scrolls down.

If the cursor is to the left of right edge (of the xnview window),
then the image starts scrolling left.

if the cursor is to the right of the right edge,
then the image pans to the right.


That seams to be what's causing the problem,
which makes the image scroll up when a selection is drawn or dragged over
or past the left or right edges from inside the xnview window.

And why the image scrolls to the left when a selection is drawn or dragged above
the bottom of the toolbar or below the top of the statusbar.


This might be a related problem:
If one starts drawing a selection and moves the mouse
below and to the right of the bottom right corner,
then the image moves (pans) 1 pixel to the left and up,
but the selection reaches all the way to the bottom right corner.

But if one now starts dragging the selection towards the bottom right corner,
then the selection jumps 1 pixel away from both the bottom and right edges.

One can move the selection to the bottom and right edges,
by moving the edges one by one.


Dragging a selection to a window edge doesn't work in fullscreen mode,
because there are no window edges visible,
and in maximized mode the left and right edges are gone.

One possible solution might be to check if a selection
is being drawn or dragged and the cursor is near or at
the xnview window edges or the screen edges,
then the image could start panning.


Something that does work as expected is,
if one drags just one edge of the selection over or past
the edge of the window, then the image scrolls normally.

It seams to be because the selections movements are
restricted to only one axis.
If one starts dragging one of the edges of a selection
and moves the cursor outside the bottom right corner
then one can see that the same problem as above occurs.


Another thing i noticed when selection edge scrolling:
The Pan tool (Settings > View > Show Pan tool)
does not update the red dotted rectangle
that shows the visible area of the image.

To have it update to the correct location,
set the right button to "move picture",
draw or drag a selection to one of the xnview window edges,
then hold down the right mouse button and move the image sligthly,
the pan tool will update, and show the correct visible area.


Tested with xnview mp v0.61 and v0.64 on linux mint 15 32bit.
User avatar
CreativeWorld
Posts: 145
Joined: Fri Dec 30, 2011 7:08 pm

Re: Selection dragging to window edges

Post by CreativeWorld »

Updated the previous post with clarifications after trying it in XnView MP v0.64.

Not sure if updating previous posts are visible anywhere, thus this post.
Post Reply