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

Method toGrid

Tools/EditorFramework/GridManager.cpp:39–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 int GridManager::toGrid(int _value, GridLine _line) const
40 {
41 if (mGridStep < 1)
42 return _value;
43
44 if (_line == Closest)
45 return (_value + mGridStep / 2) / mGridStep * mGridStep;
46 if (_line == Previous)
47 return (_value - 1) / mGridStep * mGridStep;
48 if (_line == Next)
49 return (_value + mGridStep) / mGridStep * mGridStep;
50
51 return _value;
52 }
53
54}

Callers 15

moveNewWidgetMethod · 0.80
getCoordNewWidgetMethod · 0.80
notifyChangePositionMethod · 0.80
Command_GridMoveLeftMethod · 0.80
Command_GridMoveRightMethod · 0.80
Command_GridMoveTopMethod · 0.80
Command_GridSizeLeftMethod · 0.80
Command_GridSizeRightMethod · 0.80
Command_GridSizeTopMethod · 0.80
CommandGridMoveLeftMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected