Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 00f9554

Browse files
committed
[[ libgraphics ]] Rename MCGPointGetLastPoint to MCGPointGetCurrentPoint to avoid ambiguity with previous point.
1 parent 04cf4af commit 00f9554

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libgraphics/include/graphics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ void MCGPathSimplify(MCGPathRef path, MCGPathRef& r_simple_path);
790790

791791
bool MCGPathTransform(MCGPathRef path, const MCGAffineTransform &p_transform);
792792

793-
bool MCGPathGetLastPoint(MCGPathRef self, MCGPoint &r_last);
793+
bool MCGPathGetCurrentPoint(MCGPathRef self, MCGPoint &r_current);
794794
bool MCGPathGetBoundingBox(MCGPathRef path, MCGRectangle &r_bounds);
795795

796796
typedef bool (*MCGPathIterateCallback)(void *p_context, MCGPathCommand p_command, MCGPoint *p_points, uint32_t p_point_count);

libgraphics/src/path.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -767,20 +767,20 @@ static void _MCGPathEllipticArc(MCGPathRef self, const MCGSize &p_radii, MCGFloa
767767
return;
768768
}
769769

770-
MCGPoint t_last;
771-
if (!MCGPathGetLastPoint(self, t_last))
772-
t_last = MCGPointMake(0, 0);
770+
MCGPoint t_current;
771+
if (!MCGPathGetCurrentPoint(self, t_current))
772+
t_current = MCGPointMake(0, 0);
773773

774-
if (MCGPointIsEqual(t_last, p_end_point))
774+
if (MCGPointIsEqual(t_current, p_end_point))
775775
return;
776776

777777
p_angle = fmodf(p_angle + 2 * M_PI, 2 * M_PI);
778778

779779
MCGPoint t_mid;
780-
t_mid = MCGPointGetMidPoint(t_last, p_end_point);
780+
t_mid = MCGPointGetMidPoint(t_current, p_end_point);
781781

782782
MCGPoint t_p;
783-
t_p = MCGPointRotate(MCGPointTranslate(t_last, -t_mid.x, -t_mid.y), -p_angle);
783+
t_p = MCGPointRotate(MCGPointTranslate(t_current, -t_mid.x, -t_mid.y), -p_angle);
784784

785785
MCGSize t_radii;
786786
t_radii = MCGSizeMake(MCAbs(p_radii.width), MCAbs(p_radii.height));
@@ -908,13 +908,13 @@ bool MCGPathGetBoundingBox(MCGPathRef self, MCGRectangle &r_bounds)
908908
return true;
909909
}
910910

911-
bool MCGPathGetLastPoint(MCGPathRef self, MCGPoint &r_last)
911+
bool MCGPathGetCurrentPoint(MCGPathRef self, MCGPoint &r_current)
912912
{
913913
SkPoint t_point;
914914
if (!self->path->getLastPt(&t_point))
915915
return false;
916916

917-
r_last = MCGPointFromSkPoint(t_point);
917+
r_current = MCGPointFromSkPoint(t_point);
918918
return true;
919919
}
920920

0 commit comments

Comments
 (0)