From b92f23dfe2ae9c7887489a890da735b1771a7969 Mon Sep 17 00:00:00 2001 From: "mattia@debian.org" <> Date: Sat, 7 Jan 2017 23:00:59 +0100 Subject: Fix typo in variable name s/strech/stretch/ Fixed bugs: - https://launchpad.net/bugs/1653371 (bzr r15400.1.1) --- src/live_effects/lpe-transform_2pts.cpp | 14 +++++++------- src/live_effects/lpe-transform_2pts.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-transform_2pts.cpp b/src/live_effects/lpe-transform_2pts.cpp index e1f36eee7..ef2900775 100644 --- a/src/live_effects/lpe-transform_2pts.cpp +++ b/src/live_effects/lpe-transform_2pts.cpp @@ -34,7 +34,7 @@ LPETransform2Pts::LPETransform2Pts(LivePathEffectObject *lpeobject) : flip_vertical(_("Flip vertical"), _("Flip vertical"), "flip_vertical", &wr, this, false,"", INKSCAPE_ICON("on"), INKSCAPE_ICON("off")), start(_("Start"), _("Start point"), "start", &wr, this, "Start point"), end(_("End"), _("End point"), "end", &wr, this, "End point"), - strech(_("Stretch"), _("Stretch the result"), "strech", &wr, this, 1), + stretch(_("Stretch"), _("Stretch the result"), "stretch", &wr, this, 1), offset(_("Offset"), _("Offset from knots"), "offset", &wr, this, 0), first_knot(_("First Knot"), _("First Knot"), "first_knot", &wr, this, 1), last_knot(_("Last Knot"), _("Last Knot"), "last_knot", &wr, this, 1), @@ -52,7 +52,7 @@ LPETransform2Pts::LPETransform2Pts(LivePathEffectObject *lpeobject) : registerParameter(&first_knot); registerParameter(&last_knot); registerParameter(&helper_size); - registerParameter(&strech); + registerParameter(&stretch); registerParameter(&offset); registerParameter(&start); registerParameter(&end); @@ -73,9 +73,9 @@ LPETransform2Pts::LPETransform2Pts(LivePathEffectObject *lpeobject) : offset.param_set_range(-999999.0, 999999.0); offset.param_set_increments(1, 1); offset.param_set_digits(2); - strech.param_set_range(0, 999.0); - strech.param_set_increments(0.01, 0.01); - strech.param_set_digits(4); + stretch.param_set_range(0, 999.0); + stretch.param_set_increments(0.01, 0.01); + stretch.param_set_digits(4); apply_to_clippath_and_mask = true; } @@ -379,9 +379,9 @@ LPETransform2Pts::doEffect_pwd2 (Geom::Piecewise > const m *= Geom::Scale(-1,1); m *= Geom::Rotate(original_angle); } - if(strech != 1){ + if(stretch != 1){ m *= Geom::Rotate(-original_angle); - m *= Geom::Scale(1,strech); + m *= Geom::Scale(1,stretch); m *= Geom::Rotate(original_angle); } if(elastic) { diff --git a/src/live_effects/lpe-transform_2pts.h b/src/live_effects/lpe-transform_2pts.h index c20d56206..0f88e6b00 100644 --- a/src/live_effects/lpe-transform_2pts.h +++ b/src/live_effects/lpe-transform_2pts.h @@ -57,7 +57,7 @@ private: ToggleButtonParam flip_vertical; PointParam start; PointParam end; - ScalarParam strech; + ScalarParam stretch; ScalarParam offset; ScalarParam first_knot; ScalarParam last_knot; -- cgit v1.2.3 From d994d8f220eec4293101dbe0b8299119efa6e4e0 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sun, 8 Jan 2017 12:46:00 +0100 Subject: Fix a bad inicialization of unsigned int (bzr r15402) --- src/ui/widget/registered-widget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index d410dbfe6..f66d5cbf2 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -135,7 +135,7 @@ private: repr = NULL; doc = NULL; write_undo = false; - event_type = -1; + event_type = 0; //SP_VERB_INVALID } }; -- cgit v1.2.3 From 5f0a1801ee8423cbdb4d0e86aa8502049f4e0c0f Mon Sep 17 00:00:00 2001 From: suv-lp <> Date: Mon, 9 Jan 2017 20:32:29 +0100 Subject: [Bug #1654798] Broken icon in LPE 'Fill between many' Fixed bugs: - https://launchpad.net/bugs/1654798 (bzr r15404) --- src/live_effects/parameter/originalpath.cpp | 2 +- src/live_effects/parameter/originalpatharray.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp index 2741461be..f7eb48b7a 100644 --- a/src/live_effects/parameter/originalpath.cpp +++ b/src/live_effects/parameter/originalpath.cpp @@ -56,7 +56,7 @@ OriginalPathParam::param_newWidget() } { // Paste path to link button - Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) ); + Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) ); Gtk::Button *pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp index 4ee068ebf..083abc94c 100644 --- a/src/live_effects/parameter/originalpatharray.cpp +++ b/src/live_effects/parameter/originalpatharray.cpp @@ -144,7 +144,7 @@ Gtk::Widget* OriginalPathArrayParam::param_newWidget() { // Paste path to link button - Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon("gtk-stock", Inkscape::ICON_SIZE_BUTTON) ); + Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon("edit-clone", Inkscape::ICON_SIZE_BUTTON) ); Gtk::Button *pButton = Gtk::manage(new Gtk::Button()); pButton->set_relief(Gtk::RELIEF_NONE); pIcon->show(); -- cgit v1.2.3 From 66095b4a7c8d8c38ffe727490f90de088f488574 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 10 Jan 2017 13:44:57 +0100 Subject: Another scaling option to test. (bzr r15406) --- src/file.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 756bc55bb..629e8205b 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -433,6 +433,7 @@ bool sp_file_open(const Glib::ustring &uri, scaleDialog.add_button(_("Ignore"), 3); scaleDialog.add_button("Scale test - group", 4); scaleDialog.add_button("Scale test - children", 5); + scaleDialog.add_button("Scale test - all", 6); gint response = scaleDialog.run(); backup = backupButton.get_active(); @@ -519,9 +520,34 @@ bool sp_file_open(const Glib::ustring &uri, prefs->setBool("/options/transform/rectcorners", transform_rectcorners); prefs->setBool("/options/transform/pattern", transform_pattern); prefs->setBool("/options/transform/gradient", transform_gradient); + + } else if (response == 6) { + + std::cout << "Respons 6a" << std::endl; + + // Save preferences + bool onlysensitive = prefs->getBool("/options/kbselection/onlysensitive",true); + bool onlyvisible = prefs->getBool("/options/kbselection/onlyvisible", true); + + prefs->setBool("/options/kbselection/onlysensitive", false); + prefs->setBool("/options/kbselection/onlyvisible", false); + + Inkscape::Selection *selection = desktop->getSelection(); + Inkscape::SelectionHelper::selectAllInAll( desktop ); + + double height = root->height.computed; + selection->setScaleRelative( Geom::Point(0,height), Geom::Scale(96.0/90.0,96.0/90.0) ); + std::cout << " scaling: " << 96.0/90.0 << std::endl; + selection->clear(); + + prefs->setBool("/options/kbselection/onlysensitive", onlysensitive); + prefs->setBool("/options/kbselection/onlyvisible", onlyvisible ); + + did_scaling = true; + } - need_fix_box3d = true; + need_fix_box3d = false; // setScaleRelative() handles box3d need_fix_guides = true; // Always fix guides } @@ -550,6 +576,7 @@ bool sp_file_open(const Glib::ustring &uri, scaleDialog.add_button(_("Ignore"), 3); scaleDialog.add_button("Scale test - group", 4); scaleDialog.add_button("Scale test - children", 5); + scaleDialog.add_button("Scale test - all", 6); gint response = scaleDialog.run(); backup = backupButton.get_active(); @@ -671,9 +698,47 @@ bool sp_file_open(const Glib::ustring &uri, prefs->setBool("/options/transform/gradient", transform_gradient); did_scaling = true; + } - need_fix_box3d = true; + } else if (response == 6) { + + std::cout << "Response 6b" << std::endl; + double old_height = root->height.computed; + Inkscape::Util::Quantity width = + Inkscape::Util::Quantity(doc->getWidth().value("px")/ratio, "px" ); + Inkscape::Util::Quantity height = + Inkscape::Util::Quantity(doc->getHeight().value("px")/ratio,"px" ); + doc->setWidthAndHeight( width, height, false ); + + if (!root->viewBox_set) { + + // Save preferences + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + bool onlysensitive = prefs->getBool("/options/kbselection/onlysensitive",true); + bool onlyvisible = prefs->getBool("/options/kbselection/onlyvisible", true); + + prefs->setBool("/options/kbselection/onlysensitive", false); + prefs->setBool("/options/kbselection/onlyvisible", false); + + Inkscape::Selection *selection = desktop->getSelection(); + Inkscape::SelectionHelper::selectAllInAll( desktop ); + std::cout << " scaling: " << 96.0/90.0 << std::endl; + double height = root->height.computed; + + // So far we have just enlarged the drawing but due to the + // inverted coordinate system we must scale around the old + // height position. + selection->setScaleRelative( Geom::Point(0,old_height), Geom::Scale(96.0/90.0,96.0/90.0) ); + selection->clear(); + + prefs->setBool("/options/kbselection/onlysensitive", onlysensitive); + prefs->setBool("/options/kbselection/onlyvisible", onlyvisible ); + + did_scaling = true; + } + + need_fix_box3d = false; // setScaleRelative() handls box3s need_fix_guides = true; // Only fix guides if drawing scaled } else { -- cgit v1.2.3 From 3d488c4a3091d4e14c045e85aa20b1ec96b479c0 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 10 Jan 2017 13:55:18 +0100 Subject: Remove debugging lines from last commit. (bzr r15407) --- src/file.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 629e8205b..9e96361c3 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -523,8 +523,6 @@ bool sp_file_open(const Glib::ustring &uri, } else if (response == 6) { - std::cout << "Respons 6a" << std::endl; - // Save preferences bool onlysensitive = prefs->getBool("/options/kbselection/onlysensitive",true); bool onlyvisible = prefs->getBool("/options/kbselection/onlyvisible", true); @@ -537,7 +535,6 @@ bool sp_file_open(const Glib::ustring &uri, double height = root->height.computed; selection->setScaleRelative( Geom::Point(0,height), Geom::Scale(96.0/90.0,96.0/90.0) ); - std::cout << " scaling: " << 96.0/90.0 << std::endl; selection->clear(); prefs->setBool("/options/kbselection/onlysensitive", onlysensitive); @@ -703,7 +700,6 @@ bool sp_file_open(const Glib::ustring &uri, } else if (response == 6) { - std::cout << "Response 6b" << std::endl; double old_height = root->height.computed; Inkscape::Util::Quantity width = Inkscape::Util::Quantity(doc->getWidth().value("px")/ratio, "px" ); @@ -723,7 +719,6 @@ bool sp_file_open(const Glib::ustring &uri, Inkscape::Selection *selection = desktop->getSelection(); Inkscape::SelectionHelper::selectAllInAll( desktop ); - std::cout << " scaling: " << 96.0/90.0 << std::endl; double height = root->height.computed; // So far we have just enlarged the drawing but due to the -- cgit v1.2.3 From a990b228dac4df40190334093d695e486ba1eee4 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Wed, 11 Jan 2017 14:51:54 +0000 Subject: fix comment typos (bzr r15408) --- src/ui/dialog/align-and-distribute.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 236832beb..1c88fc849 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -614,7 +614,7 @@ private : } }; -// instantiae the private static member +// instantiate the private static member boost::optional ActionExchangePositions::center; class ActionUnclump : public Action { @@ -928,7 +928,7 @@ AlignAndDistribute::AlignAndDistribute() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - //Instanciate the align buttons + //Instantiate the align buttons addAlignButton(INKSCAPE_ICON("align-horizontal-right-to-anchor"), _("Align right edges of objects to the left edge of the anchor"), 0, 0); -- cgit v1.2.3 From 5d4aa9ac147ae6db7428aa876293cf2c46fae7a5 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 11 Jan 2017 21:58:37 +0100 Subject: Fix snapping tooltips and highlighting of snapped bounding boxes (both of which were not shown) (bzr r15410) --- src/display/snap-indicator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index 17deea16d..f2271e0c6 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -287,7 +287,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap } else if (p.getSource() != SNAPSOURCE_UNDEFINED) { tooltip_str = g_strdup(source_name); } - double fontsize = prefs->getInt("/tools/measure/fontsize"); + double fontsize = prefs->getDouble("/tools/measure/fontsize", 10.0); if (tooltip_str) { Geom::Point tooltip_pos = p.getPoint(); @@ -327,7 +327,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap SP_CTRLRECT(box)->setDashed(true); SP_CTRLRECT(box)->pickable = false; // See the extensive comment above sp_canvas_item_move_to_z(box, 0); - _snaptarget_bbox = _desktop->add_temporary_canvasitem(box, timeout_val); + _snaptarget_bbox = _desktop->add_temporary_canvasitem(box, timeout_val*1000.0); } } } -- cgit v1.2.3 From 00bf8be09a333bb7434eeba9e885e6089b6eb5fd Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 12 Jan 2017 22:45:33 +0100 Subject: Use GStatBuf where appropriate to ensure usage of the correct type (fixes compilation with i686-w64-mingw32) (bzr r15414) --- src/color-profile.cpp | 2 +- src/display/cairo-utils.cpp | 2 +- src/inkscape.cpp | 2 +- src/io/sys.cpp | 2 +- src/sp-image.cpp | 2 +- src/ui/dialog/filedialogimpl-gtkmm.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 7a4dcc1cd..cbd3475b4 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -781,7 +781,7 @@ std::vector > ColorProfile::getBaseProfileDirs() static bool isIccFile( gchar const *filepath ) { bool isIccFile = false; - struct stat st; + GStatBuf st; if ( g_stat(filepath, &st) == 0 && (st.st_size > 128) ) { //0-3 == size //36-39 == 'acsp' 0x61637370 diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 01b0d807c..8045007e7 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -290,7 +290,7 @@ Pixbuf *Pixbuf::create_from_file(std::string const &fn) if (!g_file_test(fn.c_str(), G_FILE_TEST_EXISTS)) { return NULL; } - struct stat stdir; + GStatBuf stdir; int val = g_stat(fn.c_str(), &stdir); if (val == 0 && stdir.st_mode & S_IFDIR){ return NULL; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 2ba85026f..bf694ada7 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -274,7 +274,7 @@ int Application::autosave() if (doc->isModifiedSinceSave()) { gchar *oldest_autosave = 0; const gchar *filename = 0; - struct stat sb; + GStatBuf sb; time_t min_time = 0; gint count = 0; diff --git a/src/io/sys.cpp b/src/io/sys.cpp index 94175176a..61a6a96f4 100644 --- a/src/io/sys.cpp +++ b/src/io/sys.cpp @@ -226,7 +226,7 @@ bool Inkscape::IO::file_is_writable( char const *utf8name) filename = g_filename_from_utf8 ( utf8name, -1, NULL, NULL, NULL ); } if ( filename ) { - struct stat st; + GStatBuf st; if (g_file_test (filename, G_FILE_TEST_EXISTS)){ if (g_lstat (filename, &st) == 0) { success = ((st.st_mode & S_IWRITE) != 0); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index aa1dbfe20..1961971cb 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -793,7 +793,7 @@ void sp_image_refresh_if_outdated( SPImage* image ) if ( image->href && image->pixbuf && image->pixbuf->modificationTime()) { // It *might* change - struct stat st; + GStatBuf st; memset(&st, 0, sizeof(st)); int val = 0; if (g_file_test (image->pixbuf->originalPath().c_str(), G_FILE_TEST_EXISTS)){ diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index f5450ac9a..92e9ce834 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -554,7 +554,7 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType) Glib::ustring fileNameUtf8 = Glib::filename_to_utf8(fileName); gchar *fName = const_cast( fileNameUtf8.c_str()); // const-cast probably not necessary? (not necessary on Windows version of stat()) - struct stat info; + GStatBuf info; if (g_stat(fName, &info)) // stat returns 0 upon success { g_warning("SVGPreview::set() : %s : %s", fName, strerror(errno)); -- cgit v1.2.3