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

Method saveMouseRelative

Tools/LayoutEditor/TextureControl.cpp:232–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 }
231
232 void TextureControlLE::saveMouseRelative()
233 {
234 MyGUI::IntSize canvasSize = mView->getCanvasSize();
235 MyGUI::IntPoint mousePoint = MyGUI::InputManager::getInstance().getMousePositionByLayer();
236 MyGUI::IntPoint mouseOffset = mousePoint - mTexture->getAbsolutePosition();
237
238 mMouseRelative.set(
239 (float)mouseOffset.left / (float)canvasSize.width,
240 (float)mouseOffset.top / (float)canvasSize.height);
241 }
242
243 void TextureControlLE::loadMouseRelative()
244 {

Callers

nothing calls this directly

Calls 3

getCanvasSizeMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected