diff --git a/NEWS b/NEWS index f5be551..66ecb30 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,11 @@ Copyright (C) Artyom V. Poptsov are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Unreleased +** Fix ellipse drawing :BUGFIX: +Guile-PNG would fail to draw an ellipse at the specified position due to +rational number calculation errors. Now it is fixed. + * Changes in version 0.7.1 (2023-08-20) ** Fix Bresenham's Line generation algorithm :BUGFIX: Bresenham's Line generation algorithm would fail to draw properly some types diff --git a/modules/png/graphics/ellipse.scm b/modules/png/graphics/ellipse.scm index f8a6902..0f62bf6 100644 --- a/modules/png/graphics/ellipse.scm +++ b/modules/png/graphics/ellipse.scm @@ -51,8 +51,8 @@ (let* ((center (ellipse-center ellipse)) (width (ellipse-width ellipse)) (height (ellipse-height ellipse)) - (rx (/ width 2)) - (ry (/ height 2)) + (rx (inexact->exact (floor (/ width 2.0)))) + (ry (inexact->exact (floor (/ height 2.0)))) (color (graphic-color ellipse))) (define* (draw-region-2 #:key x y d2 dx dy)