forked from mirror/openmw-tes3mp
Work around MyGUI bug with mouse event coordinates (fixed in git)
This commit is contained in:
parent
59aee04ddb
commit
f9932130da
1 changed files with 19 additions and 6 deletions
|
@ -949,12 +949,18 @@ public:
|
||||||
if (!mBook)
|
if (!mBook)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
left -= mCroppedParent->getAbsoluteLeft ();
|
// work around inconsistency in MyGUI where the mouse press coordinates aren't
|
||||||
top -= mCroppedParent->getAbsoluteTop ();
|
// transformed by the current Layer (even though mouse *move* events are).
|
||||||
|
MyGUI::IntPoint pos (left, top);
|
||||||
|
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||||
|
pos = mNode->getLayer()->getPosition(left, top);
|
||||||
|
#endif
|
||||||
|
pos.left -= mCroppedParent->getAbsoluteLeft ();
|
||||||
|
pos.top -= mCroppedParent->getAbsoluteTop ();
|
||||||
|
|
||||||
if (mLastDown == MyGUI::MouseButton::None)
|
if (mLastDown == MyGUI::MouseButton::None)
|
||||||
{
|
{
|
||||||
mFocusItem = mBook->hitTest (left, mViewTop + top);
|
mFocusItem = mBook->hitTest (pos.left, mViewTop + pos.top);
|
||||||
mItemActive = true;
|
mItemActive = true;
|
||||||
|
|
||||||
dirtyFocusItem ();
|
dirtyFocusItem ();
|
||||||
|
@ -968,12 +974,19 @@ public:
|
||||||
if (!mBook)
|
if (!mBook)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
left -= mCroppedParent->getAbsoluteLeft ();
|
// work around inconsistency in MyGUI where the mouse release coordinates aren't
|
||||||
top -= mCroppedParent->getAbsoluteTop ();
|
// transformed by the current Layer (even though mouse *move* events are).
|
||||||
|
MyGUI::IntPoint pos (left, top);
|
||||||
|
#if MYGUI_VERSION < MYGUI_DEFINE_VERSION(3,2,3)
|
||||||
|
pos = mNode->getLayer()->getPosition(left, top);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pos.left -= mCroppedParent->getAbsoluteLeft ();
|
||||||
|
pos.top -= mCroppedParent->getAbsoluteTop ();
|
||||||
|
|
||||||
if (mLastDown == id)
|
if (mLastDown == id)
|
||||||
{
|
{
|
||||||
Style * mItem = mBook->hitTest (left, mViewTop + top);
|
Style * mItem = mBook->hitTest (pos.left, mViewTop + pos.top);
|
||||||
|
|
||||||
bool clicked = mFocusItem == mItem;
|
bool clicked = mFocusItem == mItem;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue