From 06f19bc758913cff0451804c6198a91c8df6a65a Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 7 Jul 2010 13:42:40 -0500 Subject: [PATCH] fixed a bug in text's color argument, as noted in PR 10998 original commit: 070a39d902a3ccb73a0c0e7d50c6bda0fe9ee69e --- collects/mrlib/image-core.rkt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/collects/mrlib/image-core.rkt b/collects/mrlib/image-core.rkt index 70ade946..63b21dbb 100644 --- a/collects/mrlib/image-core.rkt +++ b/collects/mrlib/image-core.rkt @@ -725,9 +725,13 @@ has been moved out). (let ([θ (degrees->radians (text-angle np-atomic-shape))] [font (send dc get-font)]) (send dc set-font (text->font np-atomic-shape)) - (send dc set-text-foreground - (or (send the-color-database find-color (text-color np-atomic-shape)) - (send the-color-database find-color "black"))) + (let ([color (get-color-arg (text-color np-atomic-shape))]) + (send dc set-text-foreground + (cond + [(string? color) + (or (send the-color-database find-color color) + (send the-color-database find-color "black"))] + [else color]))) (let-values ([(w h _1 _2) (send dc get-text-extent (text-string np-atomic-shape))]) (let ([p (- (make-rectangular dx dy) (* (make-polar 1 (- θ)) (make-rectangular (/ w 2) (/ h 2))))])