Lines Matching defs:anchor
16 #include "ui/draw-anchor.h"
30 * Creates an anchor object and initializes it.
57 * Destroys the anchor's canvas item and frees the anchor object.
59 SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor)
61 if (anchor->curve) {
62 anchor->curve->unref();
64 if (anchor->ctrl) {
65 sp_canvas_item_destroy(anchor->ctrl);
67 g_free(anchor);
72 * Test if point is near anchor, if so fill anchor on canvas and return
75 SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, bool activate)
77 SPCtrl *ctrl = SP_CTRL(anchor->ctrl);
79 if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) {
80 if (!anchor->active) {
81 ControlManager::getManager().setControlResize(anchor->ctrl, 4);
82 g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL);
83 anchor->active = TRUE;
85 return anchor;
88 if (anchor->active) {
89 ControlManager::getManager().setControlResize(anchor->ctrl, 0);
90 g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL);
91 anchor->active = FALSE;