From fb322430f61b32af4e22d5136704ce87ddfd6f3a Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 26 Jan 2014 02:55:13 -0500 Subject: actual_w, actual_h to fix rgbpixel on resized workspace --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 7bb1c78..5e85c3b 100644 --- a/js/util.js +++ b/js/util.js @@ -43,7 +43,7 @@ function choice(a){ return a[randint(a.length)] } function deg(n){ return n*180/PI } function rad(n){ return n*PI/180 } function xor(a,b){ a=!!a; b=!!b; return (a||b) && !(a&&b) } -function pixel(x,y){ return 4*(mod(y,h)*w+mod(x,w)) } +function pixel(x,y){ return 4*(mod(y,actual_h)*actual_w+mod(x,actual_w)) } function rgbpixel(d,x,y){ var p = pixel(~~x,~~y) r = d[p] -- cgit v1.2.3-70-g09d2