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

Method notifyMouseDrag

MyGUIEngine/src/MyGUI_Window.cpp:168–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 void Window::notifyMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MouseButton _id)
169 {
170 if (_id != MouseButton::Left)
171 return;
172
173 const IntPoint& point = InputManager::getInstance().getLastPressedPosition(MouseButton::Left);
174
175 IntCoord coord = mCurrentActionScale;
176 coord.left *= (_left - point.left);
177 coord.top *= (_top - point.top);
178 coord.width *= (_left - point.left);
179 coord.height *= (_top - point.top);
180
181 if (coord.empty())
182 return;
183
184 if (coord.left == 0 && coord.top == 0)
185 setSize((mPreActionCoord + coord).size());
186 else if (coord.width == 0 && coord.height == 0)
187 setPosition((mPreActionCoord + coord).point());
188 else
189 setCoord(mPreActionCoord + coord);
190
191 // посылаем событие о изменении позиции и размере
192 eventWindowChangeCoord(this);
193 }
194
195 void Window::updateAlpha()
196 {

Callers

nothing calls this directly

Calls 6

setSizeFunction · 0.85
setPositionFunction · 0.85
setCoordFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
pointMethod · 0.45

Tested by

no test coverage detected