[mcclim-devel] Drawing graphs & scaling

Thibault Langlois tl at di.fc.ul.pt
Fri Apr 22 14:12:24 UTC 2005


On Wed, 2005-04-20 at 23:38 -0400, Andy Hefner wrote:
> This should be fixed. Let me know if you have any further problems.
> 

It is fixed ! Thanks a lot.
Here is a screenshot:
http://www.di.fc.ul.pt/~tl/clim-scaled-graphs.png

Thibault

> On 3/22/05, Thibault Langlois <tl at di.fc.ul.pt > wrote:
>         
>         Hello,
>         
>         I would like to be able to scale a graph:
>         
>         (defmethod plot ((object tree) stream) 
>           (with-scaling (stream 0.7)
>             (draw-graph (list (root-node object))
>                         #'draw-node-colors
>                         :stream stream)))
>         
>         where draw-graph is directly inspired from an example
>         in allegro CLIM manual: 
>         
>         (defun draw-graph (root-nodes draw-node-function &rest keys)
>           (apply #'format-graph-from-roots
>                  root-nodes
>                  #'(lambda (node s)
>                      (multiple-value-bind ()
>                          (with-output-as-presentation (s node 'node)
>                            (funcall draw-node-function node s))))
>                  #'(lambda (n)
>                      (if (visible-p n)
>                          (children n)))
>                  keys))
>         and draw-node-colors draws a node using draw-rectangle*.
>         
>         The problem is that when the scaling factor is not 1 the nodes
>         are not
>         correctly placed (although they are correctly scaled) with
>         respect to arcs.
>         
>         Any ideas ?
>         
>         Thanks.
>         
>         Thibault
>         
>         _______________________________________________ 
>         mcclim-devel mailing list
>         mcclim-devel at common-lisp.net
>         http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel

-- 
Thibault Langlois FCUL / DI
tl at di.fc.ul.pt




More information about the mcclim-devel mailing list