adjust check to only insist that, when there is an editor, is it the right kind of editor.

original commit: 465d5a9f758c7b87b9e621a0ebbedefddb746176
This commit is contained in:
Robby Findler 2011-01-02 07:56:57 -06:00
parent e696606631
commit b22d6ba314

View File

@ -152,11 +152,12 @@
(set-max-height snip-height))))))))))
(define/public (recalc-snips)
(let ([editor (get-editor)])
(unless (is-a? editor text:wide-snip<%>)
(error 'recalc-snips "expected a text:wide-snip<%> editor, instead ~e" editor))
(when (eq? (send editor get-canvas) this)
(for-each (update-snip-size #t) (send editor get-wide-snips))
(for-each (update-snip-size #f) (send editor get-tall-snips)))))
(when editor
(unless (is-a? editor text:wide-snip<%>)
(error 'recalc-snips "expected a text:wide-snip<%> editor, instead ~e" editor))
(when (eq? (send editor get-canvas) this)
(for-each (update-snip-size #t) (send editor get-wide-snips))
(for-each (update-snip-size #f) (send editor get-tall-snips))))))
(define/public (add-wide-snip snip)
(let ([editor (get-editor)])
(unless (is-a? editor text:wide-snip<%>)