mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-09 22:20:41 +00:00
lottie/vector: added new addroundrect api with uniform roundness of corner.
Change-Id: Id6584d3b4fc4b81f2407ba66cafca4b6521d7fd8
This commit is contained in:
parent
3edf19165b
commit
5265f844b9
@ -215,6 +215,14 @@ void VPath::VPathData::addRect(const VRectF &rect, VPath::Direction dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VPath::VPathData::addRoundRect(const VRectF &rect, float roundness,
|
||||||
|
VPath::Direction dir)
|
||||||
|
{
|
||||||
|
if (2 * roundness > rect.width()) roundness = rect.width()/2.0;
|
||||||
|
if (2 * roundness > rect.height()) roundness = rect.height()/2.0;
|
||||||
|
addRoundRect(rect, roundness, roundness, dir);
|
||||||
|
}
|
||||||
|
|
||||||
void VPath::VPathData::addRoundRect(const VRectF &rect, float rx, float ry,
|
void VPath::VPathData::addRoundRect(const VRectF &rect, float rx, float ry,
|
||||||
VPath::Direction dir)
|
VPath::Direction dir)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,8 @@ public:
|
|||||||
void addOval(const VRectF &rect, VPath::Direction dir = Direction::CW);
|
void addOval(const VRectF &rect, VPath::Direction dir = Direction::CW);
|
||||||
void addRoundRect(const VRectF &rect, float rx, float ry,
|
void addRoundRect(const VRectF &rect, float rx, float ry,
|
||||||
VPath::Direction dir = Direction::CW);
|
VPath::Direction dir = Direction::CW);
|
||||||
|
void addRoundRect(const VRectF &rect, float roundness,
|
||||||
|
VPath::Direction dir = Direction::CW);
|
||||||
void addRect(const VRectF &rect, VPath::Direction dir = Direction::CW);
|
void addRect(const VRectF &rect, VPath::Direction dir = Direction::CW);
|
||||||
void addPolystar(float points, float innerRadius, float outerRadius,
|
void addPolystar(float points, float innerRadius, float outerRadius,
|
||||||
float innerRoundness, float outerRoundness,
|
float innerRoundness, float outerRoundness,
|
||||||
@ -62,6 +64,7 @@ private:
|
|||||||
void transform(const VMatrix &m);
|
void transform(const VMatrix &m);
|
||||||
float length() const;
|
float length() const;
|
||||||
void addRoundRect(const VRectF &, float, float, VPath::Direction);
|
void addRoundRect(const VRectF &, float, float, VPath::Direction);
|
||||||
|
void addRoundRect(const VRectF &, float, VPath::Direction);
|
||||||
void addRect(const VRectF &, VPath::Direction);
|
void addRect(const VRectF &, VPath::Direction);
|
||||||
void arcTo(const VRectF &, float, float, bool);
|
void arcTo(const VRectF &, float, float, bool);
|
||||||
void addCircle(float, float, float, VPath::Direction);
|
void addCircle(float, float, float, VPath::Direction);
|
||||||
@ -174,6 +177,12 @@ inline void VPath::addRoundRect(const VRectF &rect, float rx, float ry,
|
|||||||
d.write().addRoundRect(rect, rx, ry, dir);
|
d.write().addRoundRect(rect, rx, ry, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void VPath::addRoundRect(const VRectF &rect, float roundness,
|
||||||
|
VPath::Direction dir)
|
||||||
|
{
|
||||||
|
d.write().addRoundRect(rect, roundness, dir);
|
||||||
|
}
|
||||||
|
|
||||||
inline void VPath::addCircle(float cx, float cy, float radius,
|
inline void VPath::addCircle(float cx, float cy, float radius,
|
||||||
VPath::Direction dir)
|
VPath::Direction dir)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user