From 3ac9ac813cedec06020f215982df25f3154e0147 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 20 Apr 2006 17:32:42 +0000 Subject: [PATCH] messed around with oh mouth svn: r2727 --- collects/texpict/face-demo.ss | 5 +++-- collects/texpict/face.ss | 32 +++++++++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/collects/texpict/face-demo.ss b/collects/texpict/face-demo.ss index edd61c4fd6..4e7d5017e7 100644 --- a/collects/texpict/face-demo.ss +++ b/collects/texpict/face-demo.ss @@ -99,8 +99,9 @@ (new slider% (label "Eye Inset") (parent custom-left-panel) - (min-value 0) + (min-value -10) (max-value 10) + (init-value 0) (callback (lambda (s e) (set! face-eye-inset (send s get-value)) (new-face-callback)))) @@ -168,5 +169,5 @@ (send c min-width (inexact->exact (floor (* canvas-scale (pict-width the-pict))))) (send c min-height (inexact->exact (floor (* canvas-scale (pict-height the-pict))))) - + (send f show #t)) diff --git a/collects/texpict/face.ss b/collects/texpict/face.ss index e0045b9914..3d9206b39c 100644 --- a/collects/texpict/face.ss +++ b/collects/texpict/face.ss @@ -40,6 +40,7 @@ in-face-color)) (define face-bright-edge-color (scale-color #e1.6 face-color)) (define face-edge-color (scale-color #e0.8 face-color)) + (define face-dark-edge-color (scale-color #e0.6 face-color)) (define face-hard-edge-color (scale-color #e0.8 face-edge-color)) (let ([w 300] [h 300]) @@ -270,19 +271,24 @@ flip? 0)) (define (oh) - (series dc - (if mouth-shading? 5 0) - face-edge-color - (make-object color% "black") - (lambda (i) - (let ([sw (* w 7/20)] - [sh (* h 8/20)]) - (send dc draw-ellipse - (+ x i (/ (- w sw) 2)) - (+ y i (* h 1/4) (* h -1/16) (/ (- h sh) 2)) - (- sw (* i 2)) - (- sh (* i 2))))) - #t #t)) + (let ([do-draw + (λ (i) + (let ([sw (* w 7/20)] + [sh (* h 8/20)]) + (send dc draw-ellipse + (+ x i (/ (- w sw) 2)) + (+ y (* i .75) (* h 1/4) (* h -1/16) (/ (- h sh) 2)) + (- sw (* i 2)) + (- sh (* i 2)))))]) + (series dc + (if mouth-shading? 5 0) + face-color + face-dark-edge-color + do-draw + #t #t) + (send dc set-brush (find-brush "black")) + (send dc set-pen no-pen) + (do-draw 9))) (define (draw-eyes inset) ;; Draw eyes