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

Method notifyWindowChangeCoord

Tools/EditorFramework/SelectorControl.cpp:85–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

rightMethod · 0.80
bottomMethod · 0.80
getActionScaleMethod · 0.45

Tested by

no test coverage detected