Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 81162cc

Browse files
committed
[[ Bug 23220 ]] Ensure mouseUp is sent to image objects out of browse mode
This patch ensures that the mouseUp message is sent to image objects when the tool is image or pointer and the mouse button is released inside the image. Previously, use of an uninitialized rectangle (srect) caused the wrong message to be almost always sent.
1 parent 039113d commit 81162cc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/notes/bugfix-23220.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure clicking in an image rect in pointer mode does not send mouseRelease instead of a mouseUp message

engine/src/image.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ Boolean MCImage::mup(uint2 which, bool p_release)
465465
static_cast<MCMutableImageRep *>(m_rep) -> image_mup(which))
466466
return True;
467467

468+
MCRectangle srect;
469+
MCU_set_rect(srect, mx, my, 1, 1);
468470
switch(getstack() -> gettool(this))
469471
{
470472
case T_BROWSE:
471-
MCRectangle srect;
472-
MCU_set_rect(srect, mx, my, 1, 1);
473473
if (!p_release && maskrect(srect))
474474
message_with_args(MCM_mouse_up, which);
475475
else

0 commit comments

Comments
 (0)