Skip to content

Commit

Permalink
Match skia's path param ordering (flutter#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored and dnfield committed Apr 27, 2022
1 parent 6cd7a45 commit e94acaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions impeller/geometry/path_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ PathBuilder& PathBuilder::VerticalLineTo(Scalar y, bool relative) {
return *this;
}

PathBuilder& PathBuilder::QuadraticCurveTo(Point point,
Point controlPoint,
PathBuilder& PathBuilder::QuadraticCurveTo(Point controlPoint,
Point point,
bool relative) {
point = relative ? current_ + point : point;
controlPoint = relative ? current_ + controlPoint : controlPoint;
Expand Down Expand Up @@ -100,9 +100,9 @@ PathBuilder& PathBuilder::SmoothQuadraticCurveTo(Point point, bool relative) {
return *this;
}

PathBuilder& PathBuilder::CubicCurveTo(Point point,
Point controlPoint1,
PathBuilder& PathBuilder::CubicCurveTo(Point controlPoint1,
Point controlPoint2,
Point point,
bool relative) {
controlPoint1 = relative ? current_ + controlPoint1 : controlPoint1;
controlPoint2 = relative ? current_ + controlPoint2 : controlPoint2;
Expand Down Expand Up @@ -135,8 +135,8 @@ Point PathBuilder::ReflectedCubicControlPoint1() const {
return (current_ * 2.0) - cubic.cp2;
}

PathBuilder& PathBuilder::SmoothCubicCurveTo(Point point,
Point controlPoint2,
PathBuilder& PathBuilder::SmoothCubicCurveTo(Point controlPoint2,
Point point,
bool relative) {
auto controlPoint1 = ReflectedCubicControlPoint1();
controlPoint2 = relative ? current_ + controlPoint2 : controlPoint2;
Expand Down
12 changes: 6 additions & 6 deletions impeller/geometry/path_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ class PathBuilder {

PathBuilder& VerticalLineTo(Scalar y, bool relative = false);

PathBuilder& QuadraticCurveTo(Point point,
Point controlPoint,
PathBuilder& QuadraticCurveTo(Point controlPoint,
Point point,
bool relative = false);

PathBuilder& SmoothQuadraticCurveTo(Point point, bool relative = false);

PathBuilder& CubicCurveTo(Point point,
Point controlPoint1,
PathBuilder& CubicCurveTo(Point controlPoint1,
Point controlPoint2,
Point point,
bool relative = false);

PathBuilder& SmoothCubicCurveTo(Point point,
Point controlPoint2,
PathBuilder& SmoothCubicCurveTo(Point controlPoint2,
Point point,
bool relative = false);

PathBuilder& AddRect(Rect rect);
Expand Down

0 comments on commit e94acaa

Please sign in to comment.