[racket] question about dc% and scale

From: Garrett Mitchener (garrett.mitchener at gmail.com)
Date: Thu May 10 09:29:50 EDT 2012

Hi, I'm learning the racket GUI package, and I ran into something that
doesn't make sense to me:

#lang racket/gui

(define black-pen
  (new pen%
       [width 1]
       [color "black"]))

(define blue-brush
  (new brush%
       [color "blue"]))

(define (draw-test-2 dc)
  (send dc scale 10 10)
  (send dc set-pen black-pen)
  (send dc set-brush blue-brush)
  (send dc draw-rectangle 7 2 4 4))

(define pic (make-bitmap 200 100))

(define dc (new bitmap-dc% [bitmap pic]))

(draw-test-2 dc)

And at the end, pic looks like this:

[image: Inline image 1]
The outline and the filling don't line up.  What am I doing wrong?  This is
with DrRacket 5.2.1 on linux.

-- Garrett Mitchener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120510/53b56665/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 345 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120510/53b56665/attachment.png>

Posted on the users mailing list.