next | previous | forward | backward | up | top | index | toc | Macaulay2 website
VectorGraphics :: Draggable

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{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*-      }, GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*-      }, GraphicsCoordinate{JsFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:70:29-70:61]*-      }}
                                                                        RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*-                      RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*-                      RefPointFunc => -*Function[/usr/share/Macaulay2/VectorGraphics.m2:69:37-69:62]*-
                                       style => MutableHashTable{}
                  style => MutableHashTable{}

o6 : GraphicsList

For the programmer

The object Draggable is a symbol.