diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index c4129ca131..54fe48764d 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -655,15 +655,6 @@ void LOTShapeLayerItem::renderList(std::vector &list) mRoot->renderList(list); } -VPath::Direction LOTContentItem::direction(bool isCW) -{ - if (isCW) - return VPath::Direction::CW; - else - return VPath::Direction::CCW; -} - - LOTContentGroupItem::LOTContentGroupItem(LOTShapeGroupData *data):mData(data) { addChildren(mData); @@ -813,7 +804,7 @@ VPath LOTRectItem::getPath(int frameNo) VRectF r(pos.x() - size.x()/2, pos.y() - size.y()/2, size.x(), size.y()); VPath path; - path.addRoundRect(r, radius, radius, direction(mData->isDirectionCW())); + path.addRoundRect(r, radius, radius, mData->direction()); return path; } @@ -830,7 +821,7 @@ VPath LOTEllipseItem::getPath(int frameNo) VRectF r(pos.x() - size.x()/2, pos.y() - size.y()/2, size.x(), size.y()); VPath path; - path.addOval(r, direction(mData->isDirectionCW())); + path.addOval(r, mData->direction()); return path; } @@ -884,11 +875,11 @@ VPath LOTPolystarItem::getPath(int frameNo) path.addPolystarStar(0.0, 0.0, 0.0, points, innerRadius, outerRadius, innerRoundness, outerRoundness, - direction(mData->isDirectionCW())); + mData->direction()); } else { path.addPolystarPolygon(0.0, 0.0, 0.0, points, outerRadius, outerRoundness, - direction(mData->isDirectionCW())); + mData->direction()); } m.translate(pos.x(), pos.y()).rotate(rotation); diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 58f302d200..88d0b255af 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -215,7 +215,6 @@ public: virtual ~LOTContentItem(){} virtual void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) = 0; virtual void renderList(std::vector &list){} - VPath::Direction direction(bool isCW); }; class LOTContentGroupItem: public LOTContentItem diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index e6c5d9d275..fc3475e981 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -608,8 +608,9 @@ public: class LOTPath : public LOTData { public: - LOTPath(LOTData::Type type):LOTData(type), mDirection(3){} - bool isDirectionCW() const { return ((mDirection == 3) ? false : true );} + LOTPath(LOTData::Type type):LOTData(type), mDirection(1){} + VPath::Direction direction() { if (mDirection == 3) return VPath::Direction::CCW; + else return VPath::Direction::CW;} public: int mDirection; std::vector> mPathOperations;