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

Commit 0c879aa

Browse files
committed
[Bug 16465] libgraphics: Correct scaling for ellipses.
Remove correction factor from canvas module implementation.
1 parent 1176d30 commit 0c879aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

engine/src/module-canvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3380,7 +3380,7 @@ void MCCanvasPathMakeWithEllipse(MCCanvasPointRef p_center, MCCanvasFloat p_radi
33803380
if (!MCGPathCreateMutable(t_path))
33813381
return;
33823382

3383-
MCGPathAddEllipse(t_path, *MCCanvasPointGet(p_center), MCGSizeMake(2*p_radius_x, 2*p_radius_y), 0);
3383+
MCGPathAddEllipse(t_path, *MCCanvasPointGet(p_center), MCGSizeMake(p_radius_x, p_radius_y), 0);
33843384
if (MCGPathIsValid(t_path))
33853385
MCCanvasPathMakeWithMCGPath(t_path, r_path);
33863386

libgraphics/src/path.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ void MCGPathAddEllipse(MCGPathRef self, MCGPoint p_center, MCGSize p_radii, MCGF
457457
{
458458
// Use Skia implementation
459459
SkRect t_bounds;
460-
t_bounds = SkRect::MakeXYWH(MCGCoordToSkCoord(p_center . x - (p_radii . width * 0.5f)), MCGCoordToSkCoord(p_center . y - (p_radii . height * 0.5f)),
461-
MCGFloatToSkScalar(p_radii . width), MCGFloatToSkScalar(p_radii . height));
460+
t_bounds = SkRect::MakeXYWH(MCGCoordToSkCoord(p_center . x - p_radii . width), MCGCoordToSkCoord(p_center . y - p_radii . height),
461+
MCGFloatToSkScalar(p_radii . width * 2), MCGFloatToSkScalar(p_radii . height * 2));
462462
self -> path -> addOval(t_bounds);
463463
}
464464
}

0 commit comments

Comments
 (0)