Skip to content

Commit

Permalink
modules/png/graphics/ellipse (draw!): Bugfix
Browse files Browse the repository at this point in the history
* modules/png/graphics/ellipse.scm (draw!): Bugfix: Convert rational numbers
  to exact values in ellipse center calculations.
* NEWS: Update.
  • Loading branch information
artyom-poptsov committed Nov 26, 2023
1 parent e309e85 commit dcb41e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Copyright (C) Artyom V. Poptsov <[email protected]>
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
Expand Down
4 changes: 2 additions & 2 deletions modules/png/graphics/ellipse.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dcb41e1

Please sign in to comment.