MCPcopy Create free account
hub / github.com/Snapchat/Valdi / applyToPath

Method applyToPath

snap_drawing/src/snap_drawing/cpp/Utils/BorderRadius.cpp:67–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void BorderRadius::applyToPath(const Rect& bounds, Path& path) const {
68 Scalar radii[8];
69
70 Scalar sizeRatio = sideLengthForPercentages(bounds) / 100;
71
72 populateBorderRadius(&radii[0], sizeRatio, _topLeft, _topLeftIsPercent);
73 populateBorderRadius(&radii[2], sizeRatio, _topRight, _topRightIsPercent);
74 populateBorderRadius(&radii[4], sizeRatio, _bottomRight, _bottomRightIsPercent);
75 populateBorderRadius(&radii[6], sizeRatio, _bottomLeft, _bottomLeftIsPercent);
76
77 path.addRoundRect(bounds, radii, true);
78}
79
80bool BorderRadius::operator==(const BorderRadius& other) const {
81 return _topLeft == other._topLeft && _topRight == other._topRight && _bottomRight == other._bottomRight &&

Callers 1

drawPaintMethod · 0.80

Calls 2

populateBorderRadiusFunction · 0.85
addRoundRectMethod · 0.80

Tested by

no test coverage detected