Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong selection area when maximizing #33

Open
rioka opened this issue Jun 23, 2019 · 2 comments
Open

Wrong selection area when maximizing #33

rioka opened this issue Jun 23, 2019 · 2 comments
Labels

Comments

@rioka
Copy link

rioka commented Jun 23, 2019

I was playing around with your control, and I faced inconsistent behavior when a region of the image is selected, and the windows is then maximized.
If the container window is maximized via a double click in the title bar, the selection area is messed up; everything is correct if the window is maximized using "Maximize" button.

I tried to replicate this behavior in the provided demo, and actually "General Demonstration" shows the same problem

Steps to reproduce

  • Run the demo
  • Click on General Demonstration
  • Set "Selection Mode" to "Rectangle"
  • Select a region in the image
    • look at the values in the lower right corner
  • Maximize the window using "Maximize" button
    • look at the values in the lower right corner: they are still correct
  • Restore the previous size, using the same button
    • look at the values in the lower right corner: they are still correct
  • Maximize the window, this time double-clicking in the title bar
    • look at the values in the lower right corner: they are now wrong
    • selected region is no longer shown in the lower pan
@cyotek cyotek added the bug label Jun 24, 2019
@cyotek
Copy link
Owner

cyotek commented Jun 24, 2019

Hello,

Thanks for the bug report and the detailed repro. I just tested it with the compiled version of the demo and your steps demonstrated the issue nicely.

I suspect it's likely that because you're double clicking to maximise the window via the title bar, the ImageBox control is intercepting a mouse up event when the window is resized and the control is suddenly underneath the cursor. I tried moving the window near to the top of the screen and then double clicking, so that the mouse never entered the region of the control and the selection remained unchanged. This seems to confirm my hunch, but I'll need to do some testing with the actual source to be sure. Should be straightforward enough to fix if that's the cause. I'll update this ticket once I've had a chance to dig in the source and got a fix prepared.

Thanks again for finding this bug!

Regards;
Richard Moss

@rioka
Copy link
Author

rioka commented Jun 25, 2019

I suspect it's likely that because you're double clicking to maximise the window via the title bar...

Yeah, I think so.
Actually, I discover that because I was trying to build a simplified/updated version of your control (I wanted to add on option to force selection to have a given aspect ratio), and saw spurious MouseMove event, so I checked if that happened in the original control as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants