Logo Search packages:      
Sourcecode: inkscape version File versions

SPDrawAnchor* sp_draw_anchor_new ( SPDrawContext *  dc,
SPCurve *  curve,
gboolean  start,
Geom::Point  delta 
)

Creates an anchor object and initializes it.

Definition at line 28 of file draw-anchor.cpp.

Referenced by pen_handle_button_press(), and pencil_handle_motion_notify().

{
    if (SP_IS_LPETOOL_CONTEXT(dc)) {
        // suppress all kinds of anchors in LPEToolContext
        return NULL;
    }

    SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(dc);

    SPDrawAnchor *a = g_new(SPDrawAnchor, 1);

    a->dc = dc;
    a->curve = curve;
    curve->ref();
    a->start = start;
    a->active = FALSE;
    a->dp = delta;
    a->ctrl = sp_canvas_item_new(sp_desktop_controls(dt), SP_TYPE_CTRL,
                                 "size", 6.0,
                                 "filled", 0,
                                 "fill_color", 0xff00007f,
                                 "stroked", 1,
                                 "stroke_color", 0x000000ff,
                                 NULL);

    SP_CTRL(a->ctrl)->moveto(delta);

    return a;
}


Generated by  Doxygen 1.6.0   Back to index