adjust contour to track edit sequences better

Specifically when there is no delegate and an edit
sequence is started, track that differently in case
a delegate is set before the edit sequence ends
(in which case we don't want to end the edit
sequence in the delegate since we didn't start it
there)

related to PR 13491

original commit: 405e51bb053c5bce7b972d47706ab81ac136edd7
This commit is contained in:
Robby Findler 2013-02-05 07:51:52 -06:00
parent 014fbe20b3
commit d39761221a

View File

@ -1732,14 +1732,25 @@
(when active-canvas
(send (send active-canvas get-top-level-window) delegate-moved))))))
(define no-delegate-edit-sequence-depth 0)
(define/augment (on-edit-sequence)
(when delegate
(send delegate begin-edit-sequence))
(cond
[delegate
(send delegate begin-edit-sequence)]
[else
(set! no-delegate-edit-sequence-depth
(+ no-delegate-edit-sequence-depth 1))])
(inner (void) on-edit-sequence))
(define/augment (after-edit-sequence)
(when delegate
(send delegate end-edit-sequence))
(cond
[(and delegate
(= 0 no-delegate-edit-sequence-depth))
(send delegate end-edit-sequence)]
[else
(set! no-delegate-edit-sequence-depth
(- no-delegate-edit-sequence-depth 1))])
(inner (void) after-edit-sequence))
(define/override (resized snip redraw-now?)