fix card-games bug related to button clicks when a card click (that could be a drag) triggers an animation that throws away the button release (so that the drag internally stays active until the next event)
svn: r6227
This commit is contained in:
parent
7d6b253f30
commit
ad4fae60dc
|
@ -237,20 +237,21 @@
|
|||
(augment
|
||||
[after-interactive-move
|
||||
(lambda (e)
|
||||
(set! dragging? #f)
|
||||
(inner (void) after-interactive-move e)
|
||||
(for-each-selected (lambda (snip) (send snip back-to-original-location this)))
|
||||
(let ([cards (get-reverse-selected-list)])
|
||||
(only-front-selected) ; in case overlap changed
|
||||
(for-each
|
||||
(lambda (region)
|
||||
(when (region-hilite? region)
|
||||
(mred:queue-callback
|
||||
; Call it outside the current edit sequence
|
||||
(lambda ()
|
||||
((region-callback region) cards)
|
||||
(unhilite-region region)))))
|
||||
regions)))])
|
||||
(when dragging?
|
||||
(set! dragging? #f)
|
||||
(inner (void) after-interactive-move e)
|
||||
(for-each-selected (lambda (snip) (send snip back-to-original-location this)))
|
||||
(let ([cards (get-reverse-selected-list)])
|
||||
(only-front-selected) ; in case overlap changed
|
||||
(for-each
|
||||
(lambda (region)
|
||||
(when (region-hilite? region)
|
||||
(mred:queue-callback
|
||||
; Call it outside the current edit sequence
|
||||
(lambda ()
|
||||
((region-callback region) cards)
|
||||
(unhilite-region region)))))
|
||||
regions))))])
|
||||
(override
|
||||
[on-default-event
|
||||
(lambda (e)
|
||||
|
@ -317,6 +318,10 @@
|
|||
(set! bg-click? #f)))
|
||||
(unless bg-click?
|
||||
(super on-default-event e))
|
||||
(when (and bg-click? dragging?)
|
||||
;; We didn't call super on-default-event, so we need
|
||||
;; to explicitly end the drag:
|
||||
(after-interactive-move e))
|
||||
(when bg-click?
|
||||
; Check for clicking on a button region:
|
||||
(for-each
|
||||
|
|
Loading…
Reference in New Issue
Block a user