From 8614a2efee4b8066c819db2c714f11c341254588 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 2 Jun 2020 20:25:54 +0900 Subject: [PATCH] sw_engine: fix stroke join round result. a trivial reversed value was returned that brought the inverted arc drawing... Change-Id: I928f05b3400772a367d1653496d385354032cbad --- src/lib/sw_engine/tvgSwMath.cpp | 2 +- src/lib/sw_engine/tvgSwStroke.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/sw_engine/tvgSwMath.cpp b/src/lib/sw_engine/tvgSwMath.cpp index d2fcc4e..80c7f8e 100644 --- a/src/lib/sw_engine/tvgSwMath.cpp +++ b/src/lib/sw_engine/tvgSwMath.cpp @@ -295,7 +295,7 @@ int64_t mathMulDiv(int64_t a, int64_t b, int64_t c) } int64_t d = c > 0 ? (a * b + (c >> 1)) / c : 0x7FFFFFFFL; - return (s > 0 ? -d : d); + return (s > 0 ? d : -d); } diff --git a/src/lib/sw_engine/tvgSwStroke.cpp b/src/lib/sw_engine/tvgSwStroke.cpp index 8477d7c..e048ff5 100644 --- a/src/lib/sw_engine/tvgSwStroke.cpp +++ b/src/lib/sw_engine/tvgSwStroke.cpp @@ -134,7 +134,7 @@ static void _borderCubicTo(SwStrokeBorder* border, SwPoint& ctrl1, SwPoint& ctrl static void _borderArcTo(SwStrokeBorder* border, SwPoint& center, SwFixed radius, SwFixed angleStart, SwFixed angleDiff) { - constexpr auto ARC_CUBIC_ANGLE = ANGLE_PI / 2; + constexpr SwFixed ARC_CUBIC_ANGLE = ANGLE_PI / 2; SwPoint a = {radius, 0}; mathRotate(a, angleStart); a += center; -- 2.7.4