mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGfx/Path: Round numerator in elliptical_arc_to
This avoids rounding problems which made Ladybird crash with some SVGs on macOS/Clang.
This commit is contained in:
parent
eedd978974
commit
b3cbe0fdb9
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/warpdesign Commit: https://github.com/SerenityOS/serenity/commit/b3cbe0fdb9 Pull-request: https://github.com/SerenityOS/serenity/pull/21942 Issue: https://github.com/SerenityOS/serenity/issues/21723
@ -127,7 +127,7 @@ void Path::elliptical_arc_to(FloatPoint point, FloatSize radii, float x_axis_rot
|
||||
} else {
|
||||
double numerator = rx_sq * ry_sq - rx_sq * y1p_sq - ry_sq * x1p_sq;
|
||||
double denominator = rx_sq * y1p_sq + ry_sq * x1p_sq;
|
||||
multiplier = AK::sqrt(numerator / denominator);
|
||||
multiplier = AK::sqrt(AK::max(0., numerator) / denominator);
|
||||
}
|
||||
|
||||
if (large_arc == sweep)
|
||||
|
Loading…
Reference in New Issue
Block a user