avoid ugly nested conds
Thanks, Laurent! original commit: a8111ce91b5a8a1343310152c2b56323efe3d2fa
This commit is contained in:
parent
60a84276cf
commit
a4045a2c49
|
@ -961,21 +961,16 @@
|
||||||
(send dc set-pen old-pen)))))
|
(send dc set-pen old-pen)))))
|
||||||
|
|
||||||
(define/private (get-x-spot char-width)
|
(define/private (get-x-spot char-width)
|
||||||
(cond
|
(let/ec return
|
||||||
[char-width
|
(unless char-width (return #f))
|
||||||
(define dc (get-dc))
|
(define dc (get-dc))
|
||||||
(cond
|
(unless dc (return #f))
|
||||||
[dc
|
(define style (or (send (get-style-list) find-named-style "Standard")
|
||||||
(define style (or (send (get-style-list) find-named-style "Standard")
|
(send (get-style-list) find-named-style "Basic")))
|
||||||
(send (get-style-list) find-named-style "Basic")))
|
(unless style (return #f))
|
||||||
(cond
|
(define fnt (send style get-font))
|
||||||
[style
|
(define-values (xw _1 _2 _3) (send dc get-text-extent "x" fnt))
|
||||||
(define fnt (send style get-font))
|
(+ left-padding (* xw char-width))))))
|
||||||
(define-values (xw _1 _2 _3) (send dc get-text-extent "x" fnt))
|
|
||||||
(+ left-padding (* xw char-width))]
|
|
||||||
[else #f])]
|
|
||||||
[else #f])]
|
|
||||||
[else #f]))))
|
|
||||||
|
|
||||||
(define normalize-paste<%> (interface ((class->interface text%))
|
(define normalize-paste<%> (interface ((class->interface text%))
|
||||||
ask-normalize?
|
ask-normalize?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user