MCPcopy Create free account
hub / github.com/MyGUI/mygui / notifyMouseDrag

Method notifyMouseDrag

Tools/EditorFramework/ColourPanel.cpp:115–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114
115 void ColourPanel::notifyMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
116 {
117 if (_id != MyGUI::MouseButton::Left)
118 return;
119
120 MyGUI::Widget* parent = mImageColourPicker->getParent();
121 MyGUI::IntPoint point(_left - parent->getAbsoluteLeft(), _top - parent->getAbsoluteTop());
122
123 if (point.left < 0)
124 point.left = 0;
125 if (point.top < 0)
126 point.top = 0;
127 if (point.left > mColourRect->getWidth())
128 point.left = mColourRect->getWidth();
129 if (point.top > mColourRect->getHeight())
130 point.top = mColourRect->getHeight();
131
132 mImageColourPicker->setPosition(
133 point.left - (mImageColourPicker->getWidth() / 2),
134 point.top - (mImageColourPicker->getHeight() / 2));
135
136 updateFromPoint(point);
137 }
138
139 void ColourPanel::notifyMouseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
140 {

Callers

nothing calls this directly

Calls 4

getParentMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected