fixed bug in range highlighting -- never allow negative width rectangles

original commit: 48d338fdbab2b14aa87501a9ae1edfa804d80618
This commit is contained in:
Robby Findler 1997-10-14 17:10:13 +00:00
parent 4f27b39975
commit e8295ee015

View File

@ -334,7 +334,9 @@
[right (if (number? (rectangle-right rectangle))
(rectangle-right rectangle)
(+ view-x view-width))]
[bottom (rectangle-bottom rectangle)])
[bottom (rectangle-bottom rectangle)]
[width (max 0 (- right left))]
[height (max 0 (- bottom top))])
(let/ec k
(cond
[(and (not before)
@ -366,8 +368,8 @@
(send dc draw-rectangle
(+ left dx)
(+ top dy)
(- right left)
(- bottom top))
width
height)
(send dc set-logical-function old-logical-function)
(send dc set-pen old-pen)
(send dc set-brush old-brush)))))