fix `record-dc%' problem with regions
Closes PR 12655 original commit: 4b36e708a352f92eda50b2dd108d569e2e391620
This commit is contained in:
parent
2450c4ad0f
commit
d4643b300a
|
@ -1201,6 +1201,17 @@
|
||||||
(unless (eq? (send r is-empty?) (eq? clip 'empty))
|
(unless (eq? (send r is-empty?) (eq? clip 'empty))
|
||||||
(show-error 'draw-text "region `is-empty?' mismatch"))))))
|
(show-error 'draw-text "region `is-empty?' mismatch"))))))
|
||||||
|
|
||||||
|
(define (mutate-region)
|
||||||
|
(when (and (not clock-clip?)
|
||||||
|
(not (eq? clip 'none)))
|
||||||
|
;; To be uncooperative, mutate the clipping region:
|
||||||
|
(define r (send dc get-clipping-region))
|
||||||
|
(define r2 (make-object region% (send r get-dc)))
|
||||||
|
(send r2 union r)
|
||||||
|
(send dc set-clipping-region #f)
|
||||||
|
(send r set-rectangle 0 0 10 10)
|
||||||
|
(send dc set-clipping-region r2)))
|
||||||
|
|
||||||
;; check default pen/brush:
|
;; check default pen/brush:
|
||||||
(send dc draw-rectangle 0 0 5 5)
|
(send dc draw-rectangle 0 0 5 5)
|
||||||
(send dc draw-line 0 0 20 6)
|
(send dc draw-line 0 0 20 6)
|
||||||
|
@ -1209,6 +1220,8 @@
|
||||||
|
|
||||||
(draw-series dc pen0s pen0t pen0x "0 x 0" 5 0 0 #f)
|
(draw-series dc pen0s pen0t pen0x "0 x 0" 5 0 0 #f)
|
||||||
|
|
||||||
|
(mutate-region)
|
||||||
|
|
||||||
(draw-series dc pen1s pen1t pen1x "1 x 1" 70 0 1 #f)
|
(draw-series dc pen1s pen1t pen1x "1 x 1" 70 0 1 #f)
|
||||||
|
|
||||||
(draw-series dc pen2s pen2t pen2x "2 x 2" 135 0 2 #t)
|
(draw-series dc pen2s pen2t pen2x "2 x 2" 135 0 2 #t)
|
||||||
|
@ -1258,7 +1271,6 @@
|
||||||
|
|
||||||
(send dc set-clipping-region #f)
|
(send dc set-clipping-region #f)
|
||||||
|
|
||||||
|
|
||||||
(send dc end-page)
|
(send dc end-page)
|
||||||
(when (and kind multi-page?)
|
(when (and kind multi-page?)
|
||||||
(send dc start-page)
|
(send dc start-page)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user