From 99dad514a04e1da213fa0877c15cae5d4ca00ea0 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 10 Jul 2015 16:50:38 +0200 Subject: Force PNG bitmap export to always write with PNG extension (bzr r14238) --- src/ui/dialog/export.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 384aec415..1edfdfe80 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -945,17 +945,19 @@ Gtk::Dialog * Export::create_progress_dialog (Glib::ustring progress_text) { Glib::ustring Export::filename_add_extension (Glib::ustring filename, Glib::ustring extension) { Glib::ustring::size_type dot; + Glib::ustring::size_type dot_ext; dot = filename.find_last_of("."); - if ( !dot ) + dot_ext = filename.lowercase().rfind("." + extension.lowercase()); + if ( dot == std::string::npos ) { return filename = filename + "." + extension; } else { - if (dot==filename.find_last_of(Glib::ustring::compose(".", extension))) + if (dot == dot_ext) { - return filename; + return filename = filename; } else { -- cgit v1.2.3 From e45d61d03281d9103b3b8daf40b84e6f415eadc4 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 11 Jul 2015 00:58:49 +0200 Subject: Fix a bug continuing a bezier path whith a LPE one like spiro or bspline (bzr r14239) --- src/ui/tools/freehand-base.cpp | 7 ++++--- src/ui/tools/pen-tool.cpp | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index e8cbfcdbf..4fad06c98 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -598,9 +598,10 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ s = dc->overwrite_curve; - } - if (dc->sa->start) { - s = reverse_then_unref(s); + } else { + if (dc->sa->start) { + s = reverse_then_unref(s); + } } s->append_continuous(c, 0.0625); c->unref(); diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 38892517d..827dbf5c3 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1351,8 +1351,9 @@ void PenTool::_bsplineSpiroColor() void PenTool::_bsplineSpiro(bool shift) { - if(!this->spiro && !this->bspline) + if(!this->spiro && !this->bspline){ return; + } shift?this->_bsplineSpiroOff():this->_bsplineSpiroOn(); this->_bsplineSpiroBuild(); @@ -1413,13 +1414,19 @@ void PenTool::_bsplineSpiroStartAnchor(bool shift) }else{ this->spiro = false; } - if(!this->spiro && !this->bspline) + if(!this->spiro && !this->bspline){ + SPCurve *tmp_curve = this->sa->curve->copy(); + if (this->sa->start) { + tmp_curve = tmp_curve ->create_reverse(); + } + this->overwrite_curve = tmp_curve ; return; - - if(shift) + } + if(shift){ this->_bsplineSpiroStartAnchorOff(); - else + } else { this->_bsplineSpiroStartAnchorOn(); + } } void PenTool::_bsplineSpiroStartAnchorOn() @@ -1482,9 +1489,9 @@ void PenTool::_bsplineSpiroStartAnchorOff() } void PenTool::_bsplineSpiroMotion(bool shift){ - if(!this->spiro && !this->bspline) + if(!this->spiro && !this->bspline){ return; - + } using Geom::X; using Geom::Y; if(this->red_curve->is_empty()) return; -- cgit v1.2.3 From e0767cb0f376a7befe269e5eef9fb71d99e02c37 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 13 Jul 2015 15:50:02 +0200 Subject: Don't allow zero values for width/height and corresponding viewBox numbers. (bzr r14243) --- src/ui/widget/page-sizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 0a5697661..19ab1a280 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -266,12 +266,14 @@ PageSizer::PageSizer(Registry & _wr) _viewboxW.setDigits(2); _viewboxH.setDigits(2); + _dimensionWidth.setRange( 0.00001, 10000000 ); + _dimensionHeight.setRange( 0.00001, 10000000 ); _scaleX.setRange( 0.00001, 100000 ); _scaleY.setRange( 0.00001, 100000 ); _viewboxX.setRange( -100000, 100000 ); _viewboxY.setRange( -100000, 100000 ); - _viewboxW.setRange( 0, 200000 ); - _viewboxH.setRange( 0, 200000 ); + _viewboxW.setRange( 0.01, 200000 ); + _viewboxH.setRange( 0.01, 200000 ); _scaleY.set_sensitive (false); // We only want to display Y scale. -- cgit v1.2.3 From a3d09e2486cf76da1633c15fd40c2c39a0c06a4a Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 14 Jul 2015 00:23:14 +0200 Subject: fix "arrange" tool (typo) Fixed bugs: - https://launchpad.net/bugs/1473711 (bzr r14244) --- src/ui/dialog/grid-arrange-tab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index c44f66a4d..ccd23a572 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -311,7 +311,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h GSList *current_row = NULL; col_cnt = 0; - for(;it!=sorted.end()&&col Date: Wed, 22 Jul 2015 22:25:18 +0200 Subject: Fix a bug continuing a bezier path whith a LPE one like spiro or bspline on a start node (bzr r14252) --- src/ui/tools/freehand-base.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 4fad06c98..e8cbfcdbf 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -598,10 +598,9 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed) if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 1 || prefs->getInt(tool_name(dc) + "/freehand-mode", 0) == 2){ s = dc->overwrite_curve; - } else { - if (dc->sa->start) { - s = reverse_then_unref(s); - } + } + if (dc->sa->start) { + s = reverse_then_unref(s); } s->append_continuous(c, 0.0625); c->unref(); -- cgit v1.2.3 From f873250f0c426d7b281acd37d65c4e549eb204a3 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 24 Jul 2015 21:38:06 +0200 Subject: Make persistence of snap indicator configurable, and clean up the snapping tab in the preferences dialog Fixed bugs: - https://launchpad.net/bugs/1420301 (bzr r14253) --- src/ui/dialog/inkscape-preferences.cpp | 26 +++++++++++++++++++------- src/ui/dialog/inkscape-preferences.h | 1 + src/ui/tools/tool-base.h | 7 ++++++- src/ui/widget/preferences-widget.cpp | 1 + src/ui/widget/preferences-widget.h | 1 + 5 files changed, 28 insertions(+), 8 deletions(-) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 3b0731953..98695e080 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1229,26 +1229,38 @@ void InkscapePreferences::initPageBehavior() this->AddPage(_page_scrolling, _("Scrolling"), iter_behavior, PREFS_PAGE_BEHAVIOR_SCROLLING); // Snapping options + _page_snapping.add_group_header( _("Snap indicator")); + _snap_indicator.init( _("Enable snap indicator"), "/options/snapindicator/value", true); - _page_snapping.add_line( false, "", _snap_indicator, "", + _page_snapping.add_line( true, "", _snap_indicator, "", _("After snapping, a symbol is drawn at the point that has snapped")); - _snap_delay.init("/options/snapdelay/value", 0, 1000, 50, 100, 300, 0); - _page_snapping.add_line( false, _("_Delay (in ms):"), _snap_delay, "", - _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true); + _snap_indicator.changed_signal.connect( sigc::mem_fun(_snap_persistence, &Gtk::Widget::set_sensitive) ); + + _snap_persistence.init("/options/snapindicatorpersistence/value", 0.1, 10, 0.1, 1, 2, 1); + _page_snapping.add_line( true, _("Snap indicator persistence (in seconds):"), _snap_persistence, "", + _("Controls how long the snap indicator message will be shown, before it disappears"), true); + + _page_snapping.add_group_header( _("What should snap")); _snap_closest_only.init( _("Only snap the node closest to the pointer"), "/options/snapclosestonly/value", false); - _page_snapping.add_line( false, "", _snap_closest_only, "", + _page_snapping.add_line( true, "", _snap_closest_only, "", _("Only try to snap the node that is initially closest to the mouse pointer")); _snap_weight.init("/options/snapweight/value", 0, 1, 0.1, 0.2, 0.5, 1); - _page_snapping.add_line( false, _("_Weight factor:"), _snap_weight, "", + _page_snapping.add_line( true, _("_Weight factor:"), _snap_weight, "", _("When multiple snap solutions are found, then Inkscape can either prefer the closest transformation (when set to 0), or prefer the node that was initially the closest to the pointer (when set to 1)"), true); _snap_mouse_pointer.init( _("Snap the mouse pointer when dragging a constrained knot"), "/options/snapmousepointer/value", false); - _page_snapping.add_line( false, "", _snap_mouse_pointer, "", + _page_snapping.add_line( true, "", _snap_mouse_pointer, "", _("When dragging a knot along a constraint line, then snap the position of the mouse pointer instead of snapping the projection of the knot onto the constraint line")); + _page_snapping.add_group_header( _("Delayed snap")); + + _snap_delay.init("/options/snapdelay/value", 0, 1, 0.1, 0.2, 0.3, 1); + _page_snapping.add_line( true, _("Delay (in seconds):"), _snap_delay, "", + _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true); + this->AddPage(_page_snapping, _("Snapping"), iter_behavior, PREFS_PAGE_BEHAVIOR_SNAPPING); // Steps options diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index dcea91741..7e0184c55 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -322,6 +322,7 @@ protected: UI::Widget::PrefCheckButton _importexport_import_res_override; UI::Widget::PrefSlider _snap_delay; UI::Widget::PrefSlider _snap_weight; + UI::Widget::PrefSlider _snap_persistence; UI::Widget::PrefCheckButton _font_dialog; UI::Widget::PrefCombo _font_unit_type; UI::Widget::PrefCheckButton _font_output_px; diff --git a/src/ui/tools/tool-base.h b/src/ui/tools/tool-base.h index 7a6ab83e7..58eb6f88e 100644 --- a/src/ui/tools/tool-base.h +++ b/src/ui/tools/tool-base.h @@ -75,7 +75,12 @@ public: Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double value = prefs->getDoubleLimited("/options/snapdelay/value", 0, 0, 1000); - _timer_id = g_timeout_add(value, &sp_event_context_snap_watchdog_callback, this); + // We used to have this specified in milliseconds; this has changed to seconds now for consistency's sake + if (value > 1) { // Apparently we have an old preference file, this value must have been in milliseconds; + value = value / 1000.0; // now convert this value to seconds + } + + _timer_id = g_timeout_add(value*1000.0, &sp_event_context_snap_watchdog_callback, this); _event = gdk_event_copy((GdkEvent*) event); ((GdkEventMotion *)_event)->time = GDK_CURRENT_TIME; diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 72597e4d9..e906762e3 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -205,6 +205,7 @@ void PrefCheckButton::init(Glib::ustring const &label, Glib::ustring const &pref void PrefCheckButton::on_toggled() { + this->changed_signal.emit(this->get_active()); if (this->get_visible()) //only take action if the user toggled it { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h index 8b75b8368..1d2d77699 100644 --- a/src/ui/widget/preferences-widget.h +++ b/src/ui/widget/preferences-widget.h @@ -59,6 +59,7 @@ class PrefCheckButton : public Gtk::CheckButton public: void init(Glib::ustring const &label, Glib::ustring const &prefs_path, bool default_value); + sigc::signal changed_signal; protected: Glib::ustring _prefs_path; void on_toggled(); -- cgit v1.2.3