From: buliabyak Date: Sun, 15 Apr 2007 04:51:27 +0000 (+0000) Subject: increment hatch_spacing by hatch_spacing_step when keep_selected is off; use forced... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=681456b1f1b82b316208ecfa0add84e7b000f475;p=inkscape.git increment hatch_spacing by hatch_spacing_step when keep_selected is off; use forced redraws for all drawing modes, not only for thinning --- diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 1ee339465..d82754dba 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -198,6 +198,7 @@ sp_dyna_draw_context_init(SPDynaDrawContext *ddc) ddc->keep_selected = true; ddc->hatch_spacing = 0; + ddc->hatch_spacing_step = 0; new (&ddc->hatch_pointer_past) std::list(); new (&ddc->hatch_nearest_past) std::list(); ddc->hatch_last_nearest = NR::Point(0,0); @@ -822,12 +823,9 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, NULL, event->button.time); - if (event->motion.state & GDK_MOD1_MASK) { - sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 3); - } - ret = TRUE; + sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 3); dc->is_drawing = true; } break; @@ -1079,11 +1077,11 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, case GDK_BUTTON_RELEASE: sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); + sp_canvas_end_forced_full_redraws(desktop->canvas); dc->is_drawing = false; if ( dc->is_dilating && event->button.button == 1 ) { dc->is_dilating = false; - sp_canvas_end_forced_full_redraws(desktop->canvas); sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(dc)->desktop), SP_VERB_CONTEXT_CALLIGRAPHIC, (event->button.state & GDK_SHIFT_MASK ? _("Thicken paths") : _("Thin paths"))); @@ -1123,6 +1121,14 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, dc->hatch_item = NULL; dc->hatch_livarot_path = NULL; + if (dc->hatch_spacing != 0 && !dc->keep_selected) { + // we do not select the newly drawn path, so increase spacing by step + if (dc->hatch_spacing_step == 0) { + dc->hatch_spacing_step = dc->hatch_spacing; + } + dc->hatch_spacing += dc->hatch_spacing_step; + } + dc->_message_context->clear(); ret = TRUE; } @@ -1241,6 +1247,7 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, case GDK_Control_R: dc->_message_context->clear(); dc->hatch_spacing = 0; + dc->hatch_spacing_step = 0; break; case GDK_Alt_L: case GDK_Alt_R: @@ -1327,9 +1334,7 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize) } else { if (dc->keep_selected) { sp_desktop_selection(desktop)->set(dc->repr); - } else { - sp_desktop_selection(desktop)->clear(); - } + } } } else { diff --git a/src/dyna-draw-context.h b/src/dyna-draw-context.h index 71fc40f8c..3bb8ab5f7 100644 --- a/src/dyna-draw-context.h +++ b/src/dyna-draw-context.h @@ -108,6 +108,7 @@ struct SPDynaDrawContext bool keep_selected; double hatch_spacing; + double hatch_spacing_step; SPItem *hatch_item; Path *hatch_livarot_path; std::list hatch_nearest_past;