diff options
-rw-r--r-- | chickadee/math/rect.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chickadee/math/rect.scm b/chickadee/math/rect.scm index 3ccaf97..690d779 100644 --- a/chickadee/math/rect.scm +++ b/chickadee/math/rect.scm @@ -16,9 +16,11 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (chickadee math rect) + #:use-module (ice-9 format) #:use-module (rnrs bytevectors) #:use-module (srfi srfi-4) #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) #:use-module (chickadee math) #:use-module (chickadee math vector) #:export (make-rect @@ -81,6 +83,12 @@ rect? (bv unwrap-rect)) +(define (display-rect rect port) + (format port "#<rect x: ~f y: ~f width: ~f height: ~f>" + (rect-x rect) (rect-y rect) (rect-width rect) (rect-height rect))) + +(set-record-type-printer! <rect> display-rect) + (define (make-null-rect) (wrap-rect (make-f32vector 4 0.0))) |