From 74fce96d9242a559c3aed6461b1821e6cbe9ec12 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Sun, 7 Nov 2010 12:06:34 -0700 Subject: [PATCH] add dx offset when drawing --- collects/framework/private/text.rkt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/collects/framework/private/text.rkt b/collects/framework/private/text.rkt index 45a5f49f9d..722ad4ebfd 100644 --- a/collects/framework/private/text.rkt +++ b/collects/framework/private/text.rkt @@ -3825,7 +3825,7 @@ designates the character that triggers autocompletion (min 255 (integer (* 255 green))) (min 255 (integer (* 255 blue))))) - (define (draw-numbers dc top bottom dy start-line end-line) + (define (draw-numbers dc top bottom dx dy start-line end-line) (define (draw-text . args) (send/apply dc draw-text args)) @@ -3839,10 +3839,11 @@ designates the character that triggers autocompletion (when (between top y bottom) (define view (number->string (add1 (line-paragraph line)))) (define final-x - (case alignment - [(left) 0] - [(right) (- right-space (text-width dc view) single-space)] - [else 0])) + (+ dx + (case alignment + [(left) 0] + [(right) (- right-space (text-width dc view) single-space)] + [else 0]))) (define final-y (+ dy y)) (if (and last-paragraph (= last-paragraph (line-paragraph line))) (begin @@ -3854,8 +3855,8 @@ designates the character that triggers autocompletion (set! last-paragraph (line-paragraph line)))) ;; draw the line between the line numbers and the actual text - (define (draw-separator dc top bottom dy x) - (send dc draw-line x (+ dy top) x (+ dy bottom))) + (define (draw-separator dc top bottom dx dy x) + (send dc draw-line (+ dx x) (+ dy top) (+ dx x) (+ dy bottom))) (define line-numbers-space 0) (define/override (find-position x y . args) @@ -3871,8 +3872,8 @@ designates the character that triggers autocompletion (get-visible-line-range start-line end-line #f) ;; draw it! - (draw-numbers dc top bottom dy (unbox start-line) (add1 (unbox end-line))) - (draw-separator dc top bottom dy (text-width dc (number-space)))) + (draw-numbers dc top bottom dx dy (unbox start-line) (add1 (unbox end-line))) + (draw-separator dc top bottom dx dy (text-width dc (number-space)))) (define (text-width dc stuff) (define-values (font-width font-height baseline space)