MCPcopy Create free account
hub / github.com/JetBrains/skija / inflate

Method inflate

shared/java/RRect.java:73–98  ·  view source on GitHub ↗
(float spread)

Source from the content-addressed store, hash-verified

71 }
72
73 @Override @NotNull
74 public Rect inflate(float spread) {
75 boolean becomesRect = true;
76 for (int i = 0; i < _radii.length; ++i) {
77 if (_radii[i] + spread >= 0) {
78 becomesRect = false;
79 break;
80 }
81 }
82
83 if (becomesRect)
84 return Rect.makeLTRB(_left - spread,
85 _top - spread,
86 Math.max(_left - spread, _right + spread),
87 Math.max(_top - spread, _bottom + spread));
88 else {
89 float[] radii = Arrays.copyOf(_radii, _radii.length);
90 for (int i = 0; i < radii.length; ++i)
91 radii[i] = Math.max(0f, radii[i] + spread);
92 return new RRect(_left - spread,
93 _top - spread,
94 Math.max(_left - spread, _right + spread),
95 Math.max(_top - spread, _bottom + spread),
96 radii);
97 }
98 }
99
100 @Override
101 public String toString() {

Callers

nothing calls this directly

Calls 1

makeLTRBMethod · 0.95

Tested by

no test coverage detected