Lines Matching +full:- +full:r

33 …ommand>& cmds, Array<Point>& pts, const Point& prev, const Point& curr, const Point& next, float r)  in _roundCorner()  argument
35 auto lenPrev = length(prev - curr); in _roundCorner()
36 auto rPrev = lenPrev > 0.0f ? 0.5f * std::min(lenPrev * 0.5f, r) / lenPrev : 0.0f; in _roundCorner()
37 auto lenNext = length(next - curr); in _roundCorner()
38 auto rNext = lenNext > 0.0f ? 0.5f * std::min(lenNext * 0.5f, r) / lenNext : 0.0f; in _roundCorner()
40 auto dPrev = rPrev * (curr - prev); in _roundCorner()
41 auto dNext = rNext * (curr - next); in _roundCorner()
43 pts.push(curr - 2.0f * dPrev); in _roundCorner()
44 pts.push(curr - dPrev); in _roundCorner()
45 pts.push(curr - dNext); in _roundCorner()
46 pts.push(curr - 2.0f * dNext); in _roundCorner()
54 constexpr float epsilon = 1e-3f; in _zero()
55 return fabsf(p1.x / p2.x - 1.0f) < epsilon && fabsf(p1.y / p2.y - 1.0f) < epsilon; in _zero()
67 constexpr float epsilon = 1e-3f; in _intersect()
68 …float denom = (line1.pt2.x - line1.pt1.x) * (line2.pt2.y - line2.pt1.y) - (line1.pt2.y - line1.pt1… in _intersect()
71 …float t = ((line2.pt1.x - line1.pt1.x) * (line2.pt2.y - line2.pt1.y) - (line2.pt1.y - line1.pt1.y)… in _intersect()
72 …float u = ((line2.pt1.x - line1.pt1.x) * (line1.pt2.y - line1.pt1.y) - (line2.pt1.y - line1.pt1.y)… in _intersect()
74 intersection.x = line1.pt1.x + t * (line1.pt2.x - line1.pt1.x); in _intersect()
75 intersection.y = line1.pt1.y + t * (line1.pt2.y - line1.pt1.y); in _intersect()
76 inside = t >= -epsilon && t <= 1.0f + epsilon && u >= -epsilon && u <= 1.0f + epsilon; in _intersect()
93 for (uint32_t i = 0; i < n - 1; i++) { in _clockwise()
96 area += cross(pts[n - 1], pts[0]);; in _clockwise()
135 if (tvg::zero(inPts[currentPt - 1] - inPts[currentPt])) { in line()
140 …if (inCmds[currentCmd - 1] != PathCommand::LineTo) state.line = _offset(inPts[currentPt - 1], inPt… in line()
151 …cmd] == PathCommand::CubicTo && !tvg::zero(inPts[pt] - inPts[pt + 1]) && !tvg::zero(inPts[pt + 2] in line()
194 auto& prev = inPts[iPts - 1]; in modifyPath()
196 if (iCmds < inCmdsCnt - 1 && in modifyPath()
197 tvg::zero(inPts[iPts - 1] - inPts[iPts]) && in modifyPath()
198 tvg::zero(inPts[iPts + 1] - inPts[iPts + 2])) { in modifyPath()
200 tvg::zero(inPts[iPts + 2] - inPts[iPts + 3]) && in modifyPath()
201 tvg::zero(inPts[iPts + 4] - inPts[iPts + 5])) { in modifyPath()
202 _roundCorner(outCmds, outPts, prev, curr, inPts[iPts + 5], r); in modifyPath()
206 _roundCorner(outCmds, outPts, prev, curr, inPts[2], r); in modifyPath()
238 auto len = length(inPts[1] - inPts[2]); in modifyPolystar()
239 … auto r = len > 0.0f ? ROUNDED_POLYSTAR_MAGIC_NUMBER * std::min(len * 0.5f, this->r) / len : 0.0f; in modifyPolystar() local
252 auto& next = (i < inPts.count - start) ? inPts[i + 4] : inPts[2]; in modifyPolystar()
253 auto& nextCtrl = (i < inPts.count - start) ? inPts[i + 5] : inPts[3]; in modifyPolystar()
254 auto dNext = r * (curr - next); in modifyPolystar()
255 auto dPrev = r * (curr - prev); in modifyPolystar()
257 auto p0 = curr - 2.0f * dPrev; in modifyPolystar()
258 auto p1 = curr - dPrev; in modifyPolystar()
259 auto p2 = curr - dNext; in modifyPolystar()
260 auto p3 = curr - 2.0f * dNext; in modifyPolystar()
273 auto dPrev = r * (inPts[1] - inPts[0]); in modifyPolystar()
280 auto& next = (i == inPts.count - 1) ? inPts[1] : inPts[i + 1]; in modifyPolystar()
281 auto dNext = r * (curr - next); in modifyPolystar()
283 auto p0 = curr - 2.0f * dPrev; in modifyPolystar()
284 auto p1 = curr - dPrev; in modifyPolystar()
285 auto p2 = curr - dNext; in modifyPolystar()
286 auto p3 = curr - 2.0f * dNext; in modifyPolystar()
293 dPrev = -1.0f * dNext; in modifyPolystar()
301 bool LottieRoundnessModifier::modifyRect(const Point& size, float& r) const in modifyRect()
303 r = std::min(this->r, std::max(size.x, size.y) * 0.5f); in modifyRect()
315 auto offset = _clockwise(inPts, inPtsCnt) ? this->offset : -this->offset; in modifyPath()
326 … if (tvg::zero(inPts[iPt - 1] - inPts[iPt]) || tvg::zero(inPts[iPt + 1] - inPts[iPt + 2])) { in modifyPath()
333 stack.push({inPts[iPt - 1], inPts[iPt], inPts[iPt + 1], inPts[iPt + 2]}); in modifyPath()
336 …o len = tvg::length(bezier.start - bezier.ctrl1) + tvg::length(bezier.ctrl1 - bezier.ctrl2) + tvg:… in modifyPath()
371 if (!_zero(inPts[iPt - 1], inPts[state.movetoInIndex])) { in modifyPath()