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

Commit 94911cb

Browse files
committed
[[ Bug 17969 ]] Fixed bug causing erronous rendering when creating ovals
1 parent 950c0d7 commit 94911cb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/notes/bugfix-17969.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fixed bug preventing correct rendering of ovals when creating them

libgraphics/src/path.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ void MCGPathAddArc(MCGPathRef self, MCGPoint p_center, MCGSize p_radii, MCGFloat
488488
{
489489
// Use Skia implementation
490490
SkRect t_bounds;
491-
t_bounds = SkRect::MakeXYWH(MCGCoordToSkCoord(p_center . x - p_radii . width), MCGCoordToSkCoord(p_center . y - p_radii . height),
492-
MCGFloatToSkScalar(p_radii . width * 2), MCGFloatToSkScalar(p_radii . height * 2));
491+
t_bounds = SkRect::MakeXYWH(MCGCoordToSkCoord(p_center . x - (p_radii . width * 0.5f)), MCGCoordToSkCoord(p_center . y - (p_radii . height * 0.5f)),
492+
MCGFloatToSkScalar(p_radii . width), MCGFloatToSkScalar(p_radii . height));
493493
self -> path -> addArc(t_bounds, MCGFloatToSkScalar(p_start_angle), MCGFloatToSkScalar(p_finish_angle - p_start_angle));
494494
}
495495
}

0 commit comments

Comments
 (0)