From d3f212b98c32c3c6b12aabc3201738f4eccd6444 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 2 Dec 2015 20:50:21 -0700 Subject: [PATCH] fix copy-on-scroll for non-integer scroll offset --- gui-lib/mred/private/wxme/editor-canvas.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gui-lib/mred/private/wxme/editor-canvas.rkt b/gui-lib/mred/private/wxme/editor-canvas.rkt index a717c07d..1197e702 100644 --- a/gui-lib/mred/private/wxme/editor-canvas.rkt +++ b/gui-lib/mred/private/wxme/editor-canvas.rkt @@ -990,12 +990,14 @@ (get-canvas-background) (= x old-x)) ; could handle horizontal scrolling in the future (let-boxes ([fx 0] - [old-fy 0] - [new-fy 0]) + [old-fy* 0] + [new-fy* 0]) (let ([x (min x scroll-width)] [y (min y scroll-height)]) - (convert-scroll-to-location x y fx new-fy) - (convert-scroll-to-location old-x old-y #f old-fy)) + (convert-scroll-to-location x y fx new-fy*) + (convert-scroll-to-location old-x old-y #f old-fy*)) + (define new-fy (floor new-fy*)) + (define old-fy (floor old-fy*)) (let-boxes ([vx 0][vy 0][vw 0][vh 0]) (get-view vx vy vw vh) ; editor coords (cond