void
sp_canvastext_set_text (SPCanvasText *ct, gchar const * new_text)
{
    g_free (ct->text);
    ct->text = g_strdup(new_text);
    sp_canvas_item_request_update (SP_CANVAS_ITEM (ct));
}
Beispiel #2
0
void ControlManagerImpl::updateItem(SPCanvasItem *item)
{
    if (item) {
        double target = _sizeTable[item->ctrlType][_size - 1] + item->ctrlResize;

        g_object_set(item, "size", target, NULL);

        sp_canvas_item_request_update(item);
    }
}
Beispiel #3
0
void
sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule)
{
    g_return_if_fail (cbp != NULL);
    g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));

    cbp->fill_rgba = rgba;
    cbp->fill_rule = rule;

    sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
}
void
sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke)
{
    g_return_if_fail (ct != NULL);
    g_return_if_fail (SP_IS_CANVASTEXT (ct));

    if (rgba != ct->rgba || rgba_stroke != ct->rgba_stroke) {
        ct->rgba = rgba;
        ct->rgba_stroke = rgba_stroke;
        SPCanvasItem *item = SP_CANVAS_ITEM (ct);
        sp_canvas_item_request_update( item );
    }
}
Beispiel #5
0
void
sp_ctrlline_set_coords (SPCtrlLine *cl, gdouble x0, gdouble y0, gdouble x1, gdouble y1)
{
    g_return_if_fail (cl != NULL);
    g_return_if_fail (SP_IS_CTRLLINE (cl));

    if (DIFFER (x0, cl->s[Geom::X]) || DIFFER (y0, cl->s[Geom::Y]) || DIFFER (x1, cl->e[Geom::X]) || DIFFER (y1, cl->e[Geom::Y])) {
        cl->s[Geom::X] = x0;
        cl->s[Geom::Y] = y0;
        cl->e[Geom::X] = x1;
        cl->e[Geom::Y] = y1;
        sp_canvas_item_request_update (SP_CANVAS_ITEM (cl));
    }
}
Beispiel #6
0
void
sp_ctrlquadr_set_coords (SPCtrlQuadr *cl, Geom::Point p1, Geom::Point p2, Geom::Point p3, Geom::Point p4)
{
    g_return_if_fail (cl != NULL);
    g_return_if_fail (SP_IS_CTRLQUADR (cl));

    if (p1 != cl->p1 || p2 != cl->p2 || p3 != cl->p3 || p4 != cl->p4) {
        cl->p1 = p1;
        cl->p2 = p2;
        cl->p3 = p3;
        cl->p4 = p4;
        sp_canvas_item_request_update (SP_CANVAS_ITEM (cl));
    }
}
Beispiel #7
0
void SPCtrlCurve::setCoords( Geom::Point const &q0, Geom::Point const &q1,
                             Geom::Point const &q2, Geom::Point const &q3)
{
    if (DIFFER(p0[Geom::X], q0[Geom::X]) || DIFFER(p0[Geom::Y], q0[Geom::Y]) ||
        DIFFER(p1[Geom::X], q1[Geom::X]) || DIFFER(p1[Geom::Y], q1[Geom::Y]) ||
        DIFFER(p2[Geom::X], q2[Geom::X]) || DIFFER(p2[Geom::Y], q2[Geom::Y]) ||
        DIFFER(p3[Geom::X], q3[Geom::X]) || DIFFER(p3[Geom::Y], q3[Geom::Y]) ) {
        p0 = q0;
        p1 = q1;
        p2 = q2;
        p3 = q3;
        sp_canvas_item_request_update( this );
    }
}
void
sp_canvastext_set_coords (SPCanvasText *ct, const Geom::Point start)
{
    g_return_if_fail (ct && ct->desktop);
    g_return_if_fail (SP_IS_CANVASTEXT (ct));

    Geom::Point pos = ct->desktop->doc2dt(start);

    if (DIFFER (pos[0], ct->s[Geom::X]) || DIFFER (pos[1], ct->s[Geom::Y])) {
        ct->s[Geom::X] = pos[0];
        ct->s[Geom::Y] = pos[1];
        sp_canvas_item_request_update (SP_CANVAS_ITEM (ct));
    }
}
Beispiel #9
0
void
sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash, double gap)
{
    g_return_if_fail (cbp != NULL);
    g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));

    cbp->stroke_rgba = rgba;
    cbp->stroke_width = MAX (width, 0.1);
    cbp->stroke_linejoin = join;
    cbp->stroke_linecap = cap;
    cbp->dashes[0] = dash;
    cbp->dashes[1] = gap;

    sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
}
Beispiel #10
0
void
sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve)
{
    g_return_if_fail (cbp != NULL);
    g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));

    if (cbp->curve) {
        cbp->curve = cbp->curve->unref();
    }

    if (curve) {
        cbp->curve = curve->ref();
    }

    sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
}
void CtrlRect::_requestUpdate()
{
    sp_canvas_item_request_update(SP_CANVAS_ITEM(this));
}
Beispiel #12
0
static void
sp_canvas_arena_request_update (NRArena *arena, NRArenaItem *item, void *data)
{
	sp_canvas_item_request_update (SP_CANVAS_ITEM (data));
}