diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-01-20 09:45:43 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-01-20 09:45:43 +0000 |
| commit | a9ead40d7ef23b967f42333ec58b54266a8553a5 (patch) | |
| tree | 73841e63909abc4e982ca26f9dff122eb21e48d4 /src | |
| parent | update to trunk (diff) | |
| parent | Revert changes from r12959 and r12955, impliment new stratedgy to fix bug #16... (diff) | |
| download | inkscape-a9ead40d7ef23b967f42333ec58b54266a8553a5.tar.gz inkscape-a9ead40d7ef23b967f42333ec58b54266a8553a5.zip | |
update to trunk
(bzr r11950.1.236)
Diffstat (limited to 'src')
| -rw-r--r-- | src/document-undo.cpp | 6 | ||||
| -rw-r--r-- | src/live_effects/lpe-angle_bisector.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/lpe-perp_bisector.cpp | 4 | ||||
| -rw-r--r-- | src/selection-chemistry.cpp | 6 | ||||
| -rw-r--r-- | src/sp-item-transform.cpp | 3 | ||||
| -rw-r--r-- | src/ui/dialog/template-widget.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 12 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.h | 2 |
8 files changed, 26 insertions, 11 deletions
diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 312ccb7f8..39c8a04a0 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -155,7 +155,7 @@ void Inkscape::DocumentUndo::maybeDone(SPDocument *doc, const gchar *key, const { g_assert (doc != NULL); g_assert (doc->priv != NULL); - g_assert (doc->priv->sensitive); + g_assert (doc->priv->sensitive); if ( key && !*key ) { g_warning("Blank undo key specified."); } @@ -204,7 +204,7 @@ void Inkscape::DocumentUndo::cancel(SPDocument *doc) { g_assert (doc != NULL); g_assert (doc->priv != NULL); - g_assert (doc->priv->sensitive); + g_assert (doc->priv->sensitive); sp_repr_rollback (doc->rdoc); @@ -287,7 +287,7 @@ gboolean Inkscape::DocumentUndo::redo(SPDocument *doc) g_assert (doc != NULL); g_assert (doc->priv != NULL); - g_assert (doc->priv->sensitive); + g_assert (doc->priv->sensitive); doc->priv->sensitive = FALSE; doc->priv->seeking = true; diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp index 2f57b710b..1acf9605f 100644 --- a/src/live_effects/lpe-angle_bisector.cpp +++ b/src/live_effects/lpe-angle_bisector.cpp @@ -89,7 +89,7 @@ LPEAngleBisector::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *deskt { KnotHolderEntity *e = new AB::KnotHolderEntityRightEnd(this); e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, - _("Adjust the \"right\" of the bisector") ); + _("Adjust the \"right\" end of the bisector") ); knotholder->add(e); } }; diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp index c2a25a187..feed55b26 100644 --- a/src/live_effects/lpe-perp_bisector.cpp +++ b/src/live_effects/lpe-perp_bisector.cpp @@ -156,13 +156,13 @@ LPEPerpBisector::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *deskto { KnotHolderEntity *e = new PB::KnotHolderEntityLeftEnd(this); e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, - _("Adjust the bisector's \"left\" end") ); + _("Adjust the \"left\" end of the bisector") ); knotholder->add(e); } { KnotHolderEntity *e = new PB::KnotHolderEntityRightEnd(this); e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, - _("Adjust the bisector's \"right\" end") ); + _("Adjust the \"right\" end of the bisector") ); knotholder->add(e); } }; diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index f9649d62f..1957b9297 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1083,6 +1083,9 @@ void sp_selection_lower_to_bottom(Inkscape::Selection *selection, SPDesktop *des void sp_undo(SPDesktop *desktop, SPDocument *) { + // No re/undo while dragging, too dangerous. + if(desktop->getEventContext()->is_dragging) return; + if (!DocumentUndo::undo(sp_desktop_document(desktop))) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to undo.")); } @@ -1091,6 +1094,9 @@ sp_undo(SPDesktop *desktop, SPDocument *) void sp_redo(SPDesktop *desktop, SPDocument *) { + // No re/undo while dragging, too dangerous. + if(desktop->getEventContext()->is_dragging) return; + if (!DocumentUndo::redo(sp_desktop_document(desktop))) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to redo.")); } diff --git a/src/sp-item-transform.cpp b/src/sp-item-transform.cpp index 9dbe412d7..854fb9cd7 100644 --- a/src/sp-item-transform.cpp +++ b/src/sp-item-transform.cpp @@ -110,6 +110,9 @@ Geom::Affine get_scale_transform_for_uniform_stroke(Geom::Rect const &bbox_visua // -> The width and height of the geometric bounding box will therefore be (w0 - 2*0.5*r0) and (h0 - 2*0.5*r0) // 4) If preserve transforms is true, then stroke_x != stroke_y, since these are the apparent stroke widths, after transforming + if ((stroke_x == Geom::infinity()) || (fabs(stroke_x) < 1e-6)) stroke_x = 0; + if ((stroke_y == Geom::infinity()) || (fabs(stroke_y) < 1e-6)) stroke_y = 0; + gdouble w0 = bbox_visual.width(); // will return a value >= 0, as required further down the road gdouble h0 = bbox_visual.height(); gdouble r0 = sqrt(stroke_x*stroke_y); // r0 is redundant, used only for those cases where stroke_x = stroke_y diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index d1697244e..d8e6f9b4f 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -34,7 +34,7 @@ namespace UI { TemplateWidget::TemplateWidget() : _more_info_button(_("More info")) - , _short_description_label(_(" ")) + , _short_description_label(" ") , _template_name_label(_("no template selected")) , _effect_prefs(NULL) { diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 6c7867633..3b51147e0 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -98,6 +98,7 @@ ToolBase::ToolBase() { this->hot_x = 0; this->yp = 0; this->within_tolerance = false; + this->is_dragging = false; this->tolerance = 0; //this->key = 0; this->item_to_select = 0; @@ -977,12 +978,15 @@ gint sp_event_context_root_handler(ToolBase * event_context, gint sp_event_context_virtual_root_handler(ToolBase * event_context, GdkEvent * event) { gint ret = false; - if (event_context) { // If no event-context is available then do nothing, otherwise Inkscape would crash - // (see the comment in SPDesktop::set_event_context, and bug LP #622350) - //ret = (SP_EVENT_CONTEXT_CLASS(G_OBJECT_GET_CLASS(event_context)))->root_handler(event_context, event); - ret = event_context->root_handler(event); + if (event_context) { + if(event->type == GDK_BUTTON_PRESS) + event_context->is_dragging = true; + ret = event_context->root_handler(event); set_event_location(event_context->desktop, event); + + if(event->type == GDK_BUTTON_RELEASE) + event_context->is_dragging = false; } return ret; } diff --git a/src/ui/tools/tool-base.h b/src/ui/tools/tool-base.h index 7ed5875b1..ab8bd8caa 100644 --- a/src/ui/tools/tool-base.h +++ b/src/ui/tools/tool-base.h @@ -118,6 +118,8 @@ public: gint xp, yp; ///< where drag started gint tolerance; + bool is_dragging; // Is a tool currently dragging something + bool within_tolerance; ///< are we still within tolerance of origin SPItem *item_to_select; ///< the item where mouse_press occurred, to |
