From: johncoswell Date: Mon, 4 Sep 2006 15:46:12 +0000 (+0000) Subject: Force non-interruptible canvas redraws to ensure accurate display while creating... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6926d8baf046c184bbcc8d0a62ee00128d6415a0;p=inkscape.git Force non-interruptible canvas redraws to ensure accurate display while creating objects --- diff --git a/src/arc-context.cpp b/src/arc-context.cpp index 0b0aad79e..032d7febb 100644 --- a/src/arc-context.cpp +++ b/src/arc-context.cpp @@ -412,6 +412,8 @@ static void sp_arc_drag(SPArcContext *ac, NR::Point pt, guint state) NR::Rect const r = Inkscape::snap_rectangular_box(desktop, ac->item, pt, ac->center, state); + sp_canvas_force_full_redraws(desktop->canvas, 1); + sp_arc_position_set(SP_ARC(ac->item), r.midpoint()[NR::X], r.midpoint()[NR::Y], r.dimensions()[NR::X] / 2, r.dimensions()[NR::Y] / 2); @@ -437,6 +439,8 @@ static void sp_arc_finish(SPArcContext *ac) _("Create ellipse")); ac->item = NULL; + + sp_canvas_clear_forced_full_redraws(desktop->canvas); } } diff --git a/src/pen-context.cpp b/src/pen-context.cpp index c050c888b..adfc5eb7a 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -226,6 +226,8 @@ pen_cancel (SPPenContext *const pc) sp_canvas_item_hide(pc->cl1); pc->_message_context->clear(); pc->_message_context->flash(Inkscape::NORMAL_MESSAGE, _("Drawing cancelled")); + + sp_canvas_clear_forced_full_redraws(pc->desktop->canvas); } /** @@ -1034,6 +1036,8 @@ spdc_pen_set_subsequent_point(SPPenContext *const pc, NR::Point const p, bool st g_assert( pc->npoints != 0 ); /* todo: Check callers to see whether 2 <= npoints is guaranteed. */ + sp_canvas_force_full_redraws(pc->desktop->canvas, 4); + pc->p[2] = p; pc->p[3] = p; pc->p[4] = p; @@ -1050,6 +1054,7 @@ spdc_pen_set_subsequent_point(SPPenContext *const pc, NR::Point const p, bool st sp_curve_lineto(pc->red_curve, p); is_curve = false; } + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve); if (statusbar) { @@ -1170,6 +1175,8 @@ spdc_pen_finish(SPPenContext *const pc, gboolean const closed) pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor); } + sp_canvas_clear_forced_full_redraws(desktop->canvas); + pen_enable_events(pc); } diff --git a/src/rect-context.cpp b/src/rect-context.cpp index b03cdeead..b337b53a1 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -455,6 +455,8 @@ static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state) NR::Rect const r = Inkscape::snap_rectangular_box(desktop, rc.item, pt, rc.center, state); + sp_canvas_force_full_redraws(desktop->canvas, 2); + sp_rect_position_set(SP_RECT(rc.item), r.min()[NR::X], r.min()[NR::Y], r.dimensions()[NR::X], r.dimensions()[NR::Y]); if ( rc.rx != 0.0 ) { sp_rect_set_rx (SP_RECT(rc.item), TRUE, rc.rx); @@ -490,6 +492,8 @@ static void sp_rect_finish(SPRectContext *rc) _("Create rectangle")); rc->item = NULL; + + sp_canvas_clear_forced_full_redraws(dt->canvas); } } diff --git a/src/rubberband.cpp b/src/rubberband.cpp index cc0e70a74..49fb34592 100644 --- a/src/rubberband.cpp +++ b/src/rubberband.cpp @@ -35,6 +35,8 @@ void Inkscape::Rubberband::start(SPDesktop *d, NR::Point const &p) void Inkscape::Rubberband::stop() { + sp_canvas_clear_forced_full_redraws(_desktop->canvas); + if (_canvas) { gtk_object_destroy((GtkObject *) _canvas); _canvas = NULL; @@ -50,6 +52,8 @@ void Inkscape::Rubberband::move(NR::Point const &p) _desktop->scroll_to_point(&p); _end = p; + sp_canvas_force_full_redraws(_desktop->canvas, 2); + _canvas->setRectangle(NR::Rect(_start, _end)); } diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index 1dc6bd6cb..e878154ba 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -430,6 +430,8 @@ sp_spiral_drag(SPSpiralContext *sc, NR::Point p, guint state) arg = sp_round(arg, M_PI/snaps); } + sp_canvas_force_full_redraws(desktop->canvas, 1); + /* Fixme: these parameters should be got from dialog box */ sp_spiral_position_set(spiral, p0[NR::X], p0[NR::Y], /*expansion*/ sc->exp, @@ -462,6 +464,8 @@ sp_spiral_finish(SPSpiralContext *sc) /* TODO: annotate */ "spiral-context.cpp:462"); sc->item = NULL; + + sp_canvas_clear_forced_full_redraws(desktop->canvas); } } diff --git a/src/star-context.cpp b/src/star-context.cpp index 74b252860..fc1d71052 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -442,6 +442,8 @@ static void sp_star_drag(SPStarContext *sc, NR::Point p, guint state) arg1 = sp_round(arg1, M_PI / snaps); } + sp_canvas_force_full_redraws(desktop->canvas, 1); + sp_star_position_set(star, sc->magnitude, p0, r1, r1 * sc->proportion, arg1, arg1 + M_PI / sides, sc->isflatsided, sc->rounded, sc->randomized); @@ -474,6 +476,8 @@ sp_star_finish (SPStarContext * sc) /* TODO: annotate */ "star-context.cpp:474"); sc->item = NULL; + + sp_canvas_clear_forced_full_redraws(desktop->canvas); } }