Macaulay2 » Documentation
Packages » VectorGraphics :: Draggable
next | previous | forward | backward | up | index | toc

Draggable -- An option to make a GraphicsObject draggable

Description

If this option is turned on, the GraphicsObject can be dragged with the mouse (left button for translation, right button for rotation). It this object is reused as coordinate for other objects, they will be updated accordingly. Compare the following two examples:

i1 : circ = Circle{Radius=>0.1,"fill"=>"red"}; a = gNode([-1,0],circ,Draggable=>true); b = gNode([1,0.5],circ,Draggable=>true);  c = gNode([1,-0.5],circ,Draggable=>true);
i5 : gList(Polygon{{[-1,0],[1,0.5],[1,-0.5]}},a,b,c)

o5 = GraphicsList{cache => CacheTable{}                                                 }
                  Contents => {Polygon{cache => CacheTable{}                 }, a, b, c}
                                       PointList => {| -1 |, |  1 |, |  1  |}
                                                     |  0 |  | .5 |  | -.5 |
                                                     |  0 |  |  0 |  |  0  |
                                                     |  1 |  |  1 |  |  1  |
                                       style => MutableHashTable{}
                  style => MutableHashTable{}

o5 : GraphicsList
i6 : gList(Polygon{{a,b,c}},a,b,c)

o6 = GraphicsList{cache => CacheTable{}                                                                                          }
                  Contents => {Polygon{cache => CacheTable{}                                                          }, a, b, c}
                                       PointList => {GraphicsCoordinate a, GraphicsCoordinate b, GraphicsCoordinate c}
                                       style => MutableHashTable{}
                  style => MutableHashTable{}

o6 : GraphicsList

For the programmer

The object Draggable is a symbol.