mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 14:02:48 +00:00
lottie/vector: fine tune path api.
Change-Id: Ic40da16809e5e0b32f5d23cc8b06636d37072037
This commit is contained in:
parent
446a18a1e5
commit
fa645a5227
@ -155,7 +155,7 @@ void VPath::VPathData::addOval(const VRectF &rect, VPath::Direction dir)
|
|||||||
float h2 = rect.height() / 2;
|
float h2 = rect.height() / 2;
|
||||||
float h2k = h2 * PATH_KAPPA;
|
float h2k = h2 * PATH_KAPPA;
|
||||||
|
|
||||||
reserve(14, 7); // 1Move + 4Cubic + 1Close
|
reserve(13, 6); // 1Move + 4Cubic + 1Close
|
||||||
if (dir == VPath::Direction::CW) {
|
if (dir == VPath::Direction::CW) {
|
||||||
// moveto 12 o'clock.
|
// moveto 12 o'clock.
|
||||||
moveTo(x + w2, y);
|
moveTo(x + w2, y);
|
||||||
@ -199,7 +199,7 @@ void VPath::VPathData::addRect(const VRectF &rect, VPath::Direction dir)
|
|||||||
float w = rect.width();
|
float w = rect.width();
|
||||||
float h = rect.height();
|
float h = rect.height();
|
||||||
|
|
||||||
reserve(6, 6); // 1Move + 4Line + 1Close
|
reserve(5, 6); // 1Move + 4Line + 1Close
|
||||||
if (dir == VPath::Direction::CW) {
|
if (dir == VPath::Direction::CW) {
|
||||||
moveTo(x + w, y);
|
moveTo(x + w, y);
|
||||||
lineTo(x + w, y + h);
|
lineTo(x + w, y + h);
|
||||||
@ -233,7 +233,7 @@ void VPath::VPathData::addRoundRect(const VRectF &rect, float rx, float ry,
|
|||||||
if (rx > w) rx = w;
|
if (rx > w) rx = w;
|
||||||
if (ry > h) ry = h;
|
if (ry > h) ry = h;
|
||||||
|
|
||||||
reserve(14, 7); // 1Move + 4Cubic + 1Close
|
reserve(17, 10); // 1Move + 4Cubic + 1Close
|
||||||
if (dir == VPath::Direction::CW) {
|
if (dir == VPath::Direction::CW) {
|
||||||
moveTo(x + w, y + ry / 2.f);
|
moveTo(x + w, y + ry / 2.f);
|
||||||
arcTo(VRectF(x + w - rx, y + h - ry, rx, ry), 0, -90, false);
|
arcTo(VRectF(x + w - rx, y + h - ry, rx, ry), 0, -90, false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user