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

Function cropPolygon

MyGUIEngine/src/MyGUI_GeometryUtility.cpp:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13 VectorFloatPoint cropPolygon(FloatPoint* _baseVerticiesPos, size_t _size, const IntCoord& _cropRectangle)
14 {
15 VectorFloatPoint resultVerticiesPos;
16 resultVerticiesPos.resize(_size);
17 for (size_t i = 0; i < _size; ++i)
18 {
19 resultVerticiesPos[i] = _baseVerticiesPos[i];
20 }
21
22 cropPolygonSide(resultVerticiesPos, _cropRectangle.left, Left);
23 cropPolygonSide(resultVerticiesPos, _cropRectangle.right(), Right);
24 cropPolygonSide(resultVerticiesPos, _cropRectangle.top, Top);
25 cropPolygonSide(resultVerticiesPos, _cropRectangle.bottom(), Bottom);
26
27 return resultVerticiesPos;
28 }
29
30 void cropPolygonSide(VectorFloatPoint& _verticies, int _sideCoord, Side _side)
31 {

Callers 2

_rebuildGeometryMethod · 0.85
_rebuildGeometryMethod · 0.85

Calls 4

cropPolygonSideFunction · 0.85
rightMethod · 0.80
bottomMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected