MCPcopy Create free account
hub / github.com/Tencent/tgfx / getBounds

Method getBounds

test/src/CanvasTest.cpp:1565–1581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1563 }
1564
1565 Rect getBounds() const override {
1566 if (points.size() < 2) {
1567 return {};
1568 }
1569
1570 float minX = points[0].x;
1571 float minY = points[0].y;
1572 float maxX = points[0].x;
1573 float maxY = points[0].y;
1574 for (const auto& point : points) {
1575 minX = std::min(minX, point.x);
1576 minY = std::min(minY, point.y);
1577 maxX = std::max(maxX, point.x);
1578 maxY = std::max(maxY, point.y);
1579 }
1580 return Rect::MakeXYWH(minX, minY, maxX - minX, maxX - minX);
1581 }
1582
1583 private:
1584 std::vector<Point> points = {};

Callers 4

TGFX_TESTFunction · 0.45
TGFX_TESTFunction · 0.45
TGFX_TESTFunction · 0.45
TGFX_TESTFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected