[racket] Problem with hline in

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat May 26 12:03:10 EDT 2012

2012/5/26 Robby Findler <robby at eecs.northwestern.edu>:
> Oh, in that case, you could do this:
>
> (hc-append (blank 1 0) (hline (- w 1) 1))

Thanks!

> If you don't want the rounded edges, you'd have to do something like this:
>
> (define (fraction p q)
>  (define w (max (pict-width p) (pict-width q)))
>  (vc-append p (vc-append (blank 0 2) (butt-hline w)) q))
>
> (require racket/gui/base)
> (define (butt-hline w)
>  (dc
>   (λ (dc dx dy)
>     (define pen (send dc get-pen))
>     (send dc set-pen (send the-pen-list find-or-create-pen
>                            (send pen get-color)
>                            (send pen get-width)
>                            'solid
>                            'butt))
>     (send dc draw-line dx dy (+ dx w) dy))
>   w 1))

I think I can use this technique to make roots.
And to make a proper "vector arrow".

Thanks,
Jens Axel


Posted on the users mailing list.