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

Method moveTo

MyGUIEngine/src/msdfgen/core/Scanline.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88#endif
89
90int Scanline::moveTo(double x) const {
91 if (intersections.empty())
92 return -1;
93 int index = lastIndex;
94 if (x < intersections[index].x) {
95 do {
96 if (index == 0) {
97 lastIndex = 0;
98 return -1;
99 }
100 --index;
101 } while (x < intersections[index].x);
102 } else {
103 while (index < (int) intersections.size()-1 && x >= intersections[index+1].x)
104 ++index;
105 }
106 lastIndex = index;
107 return index;
108}
109
110int Scanline::countIntersections(double x) const {
111 return moveTo(x)+1;

Callers 3

gatherPathsFunction · 0.80
finishAttributesMethod · 0.80
shapeToSkiaPathFunction · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected