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

Method notifyWindowChangeCoord

Tools/LayoutEditor/SelectorControl.cpp:84–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void SelectorControlLE::notifyWindowChangeCoord(MyGUI::Window* _sender)
85 {
86 MyGUI::IntCoord coord = _sender->getCoord() - mProjectionDiff;
87 const MyGUI::IntCoord& actionScale = _sender->getActionScale();
88
89 if (actionScale.left != 0 && actionScale.width != 0)
90 {
91 int right = mCoordValue.right();
92 mCoordValue.width = (int)((double)coord.width / mScaleValue);
93 mCoordValue.left = right - mCoordValue.width;
94 }
95 else
96 {
97 mCoordValue.left = (int)((double)coord.left / mScaleValue);
98 mCoordValue.width = (int)((double)coord.width / mScaleValue);
99 }
100
101 if (actionScale.top != 0 && actionScale.height != 0)
102 {
103 int bottom = mCoordValue.bottom();
104 mCoordValue.height = (int)((double)coord.height / mScaleValue);
105 mCoordValue.top = bottom - mCoordValue.height;
106 }
107 else
108 {
109 mCoordValue.top = (int)((double)coord.top / mScaleValue);
110 mCoordValue.height = (int)((double)coord.height / mScaleValue);
111 }
112
113 updateCoord();
114 eventChangePosition();
115 }
116
117 MyGUI::IntPoint SelectorControlLE::getPosition()
118 {

Callers

nothing calls this directly

Calls 3

rightMethod · 0.80
bottomMethod · 0.80
getActionScaleMethod · 0.45

Tested by

no test coverage detected