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

Method position

Tools/LayoutEditor/WidgetContainer.cpp:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 std::string WidgetContainer::position(bool _percent)
44 {
45 if (mRelativeMode)
46 {
47 MyGUI::DoubleCoord coord =
48 MyGUI::CoordConverter::convertToRelativeD(mWidget->getCoord(), mWidget->getParentSize());
49 std::ostringstream stream;
50 stream.precision(17);
51 if (_percent)
52 stream << coord.left * 100 << " " << coord.top * 100 << " " << coord.width * 100 << " "
53 << coord.height * 100;
54 else
55 stream << coord.left << " " << coord.top << " " << coord.width << " " << coord.height;
56 return stream.str();
57 }
58 return mWidget->getCoord().print();
59 }
60
61 void WidgetContainer::setUserData(std::string_view _key, std::string_view _value)
62 {

Callers 3

serialiseWidgetMethod · 0.80
updateMethod · 0.80
updatePositionCaptionMethod · 0.80

Calls 4

convertToRelativeDFunction · 0.85
getParentSizeMethod · 0.80
strMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected