Skip to content

Commit c781f26

Browse files
committed
missed a situation where narrowing the bitmap requires more area to be redrawn
1 parent 4e00b3e commit c781f26

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

gui-lib/framework/private/text-inline-overview.rkt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
(define/private (reset-entire-overview)
7777
(define h (last-paragraph))
78+
(define previous-bmp-width bmp-width)
7879
(update-bmp-width)
7980
(define to-create-h (+ h 20))
8081
(unless (and primary-bmp
@@ -83,6 +84,11 @@
8384
(set! primary-bmp (unsafe:make-bitmap bmp-width to-create-h))
8485
(set! secondary-bmp (unsafe:make-bitmap bmp-width to-create-h))
8586
(set! known-blank 0))
87+
(when (> previous-bmp-width bmp-width)
88+
(invalidate-entire-overview-region
89+
#t
90+
#:extra-left-width
91+
(- previous-bmp-width bmp-width)))
8692
(union-invalid 0 h)
8793
(maybe-queue-do-a-little-work?))
8894

@@ -266,16 +272,16 @@
266272
;; invalidates only the newly exposed region
267273
(invalidate-entire-overview-region #f)))
268274

269-
(define/private (invalidate-entire-overview-region just-union? #:use-this-width [use-this-width #f])
275+
(define/private (invalidate-entire-overview-region just-union? #:extra-left-width [extra-left-width 0])
270276
(define-values (view-height
271277
bitmap-first-visible-paragraph
272278
top-paragraph
273279
bot-paragraph
274280
bitmap-x-coordinate
275281
bitmap-y-coordinate)
276282
(get-bitmap-placement-info))
277-
(define x (- bitmap-x-coordinate extra-blue-parts-margin))
278-
(define w (+ (or use-this-width bmp-width) extra-blue-parts-margin))
283+
(define x (- bitmap-x-coordinate extra-blue-parts-margin extra-left-width))
284+
(define w (+ bmp-width extra-left-width extra-blue-parts-margin))
279285
(cond
280286
[just-union?
281287
(union-region-to-invalidate x
@@ -508,7 +514,7 @@
508514
;; if the bitmap gets narrower,
509515
;; the invalidate-entire-overview-region
510516
;; below won't invalidate a big enough region
511-
(invalidate-entire-overview-region #t #:use-this-width previous-bmp-width))
517+
(invalidate-entire-overview-region #t #:extra-left-width (- previous-bmp-width bmp-width)))
512518
(not (= previous-bmp-width bmp-width))]
513519
[else #f]))
514520
(when bmp-width-changed?

0 commit comments

Comments
 (0)