From 6871bbf07c15217757fc33a723e18e5484ae3b5e Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 6 Mar 2012 11:05:01 -0500 Subject: [PATCH] correcting scaling bug --- image/private/kernel.js | 4 ++-- tests/clipart-test/clipart.rkt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/image/private/kernel.js b/image/private/kernel.js index 1b0a6d9..8fe4d12 100644 --- a/image/private/kernel.js +++ b/image/private/kernel.js @@ -619,8 +619,8 @@ var ScaleImage = function(xFactor, yFactor, img) { Math.floor((img.getHeight() * yFactor) / 2)); this.img = img; - this.width = img.getWidth() * xFactor; - this.height = img.getHeight() * yFactor; + this.width = Math.floor(img.getWidth() * xFactor); + this.height = Math.floor(img.getHeight() * yFactor); this.xFactor = xFactor; this.yFactor = yFactor; }; diff --git a/tests/clipart-test/clipart.rkt b/tests/clipart-test/clipart.rkt index f8b86e3..831a6e3 100644 --- a/tests/clipart-test/clipart.rkt +++ b/tests/clipart-test/clipart.rkt @@ -116,6 +116,9 @@ ;(define D (overlay XDOG BG)) ;(define CDOG (overlay (clipart/url DOGURL) BG)) ;D +(image-width DOG) +(image-height DOG) + (define colors (image->color-list DOG)) (displayln (length colors))