[Feature Request] Dragging Square Area for Cutting

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
Leon Cheung
Posts: 5
Joined: Fri Nov 22, 2013 9:10 am

[Feature Request] Dragging Square Area for Cutting

Post by Leon Cheung »

When we are going to make the cut on the image, we always make border select on the image by dragging a rectangle. But can we quickly drag out a regular square for that? For example, like hoding Ctrl or Shift when dragging. It would be very helpful and convenient. FYI. Thank you!
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Re: [Feature Request] Dragging Square Area for Cutting

Post by m.Th. »

Leon Cheung wrote:When we are going to make the cut on the image, we always make border select on the image by dragging a rectangle. But can we quickly drag out a regular square for that? For example, like hoding Ctrl or Shift when dragging. It would be very helpful and convenient. FYI. Thank you!
Shift.

It is the standard dictated by Adobe's Photoshop.

At least on Windows is relatively easy to implement: if GetAsyncKeyState(VK_SHIFT)<0 then...
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
User avatar
Leon Cheung
Posts: 5
Joined: Fri Nov 22, 2013 9:10 am

Re: [Feature Request] Dragging Square Area for Cutting

Post by Leon Cheung »

m.Th. wrote:
Leon Cheung wrote:When we are going to make the cut on the image, we always make border select on the image by dragging a rectangle. But can we quickly drag out a regular square for that? For example, like hoding Ctrl or Shift when dragging. It would be very helpful and convenient. FYI. Thank you!
Shift.

It is the standard dictated by Adobe's Photoshop.

At least on Windows is relatively easy to implement: if GetAsyncKeyState(VK_SHIFT)<0 then...
Agree. Shift would be nice. I really hope it could be implemented soon. :)
User avatar
CreativeWorld
Posts: 141
Joined: Fri Dec 30, 2011 7:08 pm

Re: [Feature Request] Dragging Square Area for Cutting

Post by CreativeWorld »

This works in v0.64, thanks.

Just one improvement that could be made is that,
when the left mouse button is held down and one drags out a selection,
if the mouse pointer is stationary,
and one holds down the shift key,
then nothing happens.

The mouse has to be moved (cause a drag action),
for the selection to update and get an aspect ratio of 1:1,
the same thing happens if one releases the shift key,
the selection doesn't update until the mouse is moved.

Tested with XnView MP v0.64 on linux mint 15 cinnamon 32bit.
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Re: [Feature Request] Dragging Square Area for Cutting

Post by m.Th. »

CreativeWorld wrote:This works in v0.64, thanks.

Just one improvement that could be made is that,
when the left mouse button is held down and one drags out a selection,
if the mouse pointer is stationary,
and one holds down the shift key,
then nothing happens.

The mouse has to be moved (cause a drag action),
for the selection to update and get an aspect ratio of 1:1,
the same thing happens if one releases the shift key,
the selection doesn't update until the mouse is moved.

Tested with XnView MP v0.64 on linux mint 15 cinnamon 32bit.
Rather difficult to implement. By 'difficult' I mean that It doesn't worth the effort.

He hooks the Mouse Move event and test inside of it if the Shift key is pressed. Simple and clean to implement and to maintain.
What do you want, implies a test in the main Key Press event. Hmmm... it could lead to complications, if you'd ask me.
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Re: [Feature Request] Dragging Square Area for Cutting

Post by m.Th. »

And now a real bug here: :)

1. Select a square area by pressing Shift
2. By keeping the Shift pressed, try to change the selection by dragging from other corners of the selection (particularly the bottom-left and the top-right ones)
3. Enjoy! :)
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
User avatar
xnview
Author of XnView
Posts: 44922
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: [Feature Request] Dragging Square Area for Cutting

Post by xnview »

See Issue 201 for current status and details.
Pierre.