From 4436eae1a6810e3630679898f91fe1995d1fae7e Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 10 Aug 2014 15:29:46 +0200 Subject: Export. Fix for Bug #1166184 (XAML export not compatible with Silverlight). Fixed bugs: - https://launchpad.net/bugs/1166184 (bzr r13505) --- src/extension/implementation/xslt.cpp | 40 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index bcea06cb5..85ae9efde 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -20,6 +20,7 @@ #include "xslt.h" #include "../extension.h" #include "../output.h" +#include "extension/input.h" #include "xml/repr.h" #include "io/sys.h" @@ -53,8 +54,7 @@ XSLT::XSLT(void) : { } -Glib::ustring -XSLT::solve_reldir(Inkscape::XML::Node *reprin) { +Glib::ustring XSLT::solve_reldir(Inkscape::XML::Node *reprin) { gchar const *s = reprin->attribute("reldir"); @@ -90,8 +90,7 @@ XSLT::solve_reldir(Inkscape::XML::Node *reprin) { return ""; } -bool -XSLT::check(Inkscape::Extension::Extension *module) +bool XSLT::check(Inkscape::Extension::Extension *module) { if (load(module)) { unload(module); @@ -101,8 +100,7 @@ XSLT::check(Inkscape::Extension::Extension *module) } } -bool -XSLT::load(Inkscape::Extension::Extension *module) +bool XSLT::load(Inkscape::Extension::Extension *module) { if (module->loaded()) { return true; } @@ -130,8 +128,7 @@ XSLT::load(Inkscape::Extension::Extension *module) return true; } -void -XSLT::unload(Inkscape::Extension::Extension *module) +void XSLT::unload(Inkscape::Extension::Extension *module) { if (!module->loaded()) { return; } xsltFreeStylesheet(_stylesheet); @@ -139,8 +136,8 @@ XSLT::unload(Inkscape::Extension::Extension *module) return; } -SPDocument * -XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) +SPDocument * XSLT::open(Inkscape::Extension::Input */*module*/, + gchar const *filename) { xmlDocPtr filein = xmlParseFile(filename); if (filein == NULL) { return NULL; } @@ -184,8 +181,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) return doc; } -void -XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const *filename) +void XSLT::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename) { /* TODO: Should we assume filename to be in utf8 or to be a raw filename? * See JavaFXOutput::save for discussion. */ @@ -214,10 +210,24 @@ XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const return; } - const char * params[1]; - params[0] = NULL; + std::list params; + module->paramListString(params); + const int max_parameters = params.size() * 2; + const char * xslt_params[max_parameters+1] ; + + int count = 0; + for(std::list::iterator t=params.begin(); t != params.end(); ++t) { + std::size_t pos = t->find("="); + std::ostringstream parameter; + std::ostringstream value; + parameter << t->substr(2,pos-2); + value << t->substr(pos+1); + xslt_params[count++] = g_strdup_printf("%s", parameter.str().c_str()); + xslt_params[count++] = g_strdup_printf("'%s'", value.str().c_str()); + } + xslt_params[count] = NULL; - xmlDocPtr newdoc = xsltApplyStylesheet(_stylesheet, svgdoc, params); + xmlDocPtr newdoc = xsltApplyStylesheet(_stylesheet, svgdoc, xslt_params); //xmlSaveFile(filename, newdoc); int success = xsltSaveResultToFilename(filename, newdoc, _stylesheet, 0); -- cgit v1.2.3 From c73ebf3c732e19f665de2d490a915eabf425905e Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 13 Aug 2014 08:24:04 +0200 Subject: Printing. Fix for Bug #264831 (Print settings not persistent). Printing. Fix for Bug #508529 (Printing rastered image offsets the page). Fixed bugs: - https://launchpad.net/bugs/264831 - https://launchpad.net/bugs/508529 (bzr r13509) --- src/ui/dialog/print.cpp | 8 +++++++- src/ui/widget/rendering-options.cpp | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 03ac9dc64..4d8d512df 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -18,6 +18,7 @@ #include #endif +#include "preferences.h" #include "print.h" #include @@ -44,14 +45,18 @@ static void draw_page( gint /*page_nr*/, gpointer user_data) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data; //printf("%s %d\n",__FUNCTION__, page_nr); if (junk->_tab->as_bitmap()) { // Render as exported PNG + prefs->setBool("/dialogs/printing/asbitmap", true); gdouble width = (junk->_doc)->getWidth().value("px"); gdouble height = (junk->_doc)->getHeight().value("px"); gdouble dpi = junk->_tab->bitmap_dpi(); + prefs->setDouble("/dialogs/printing/dpi", dpi); + std::string tmp_png; std::string tmp_base = "inkscape-print-png-XXXXXX"; @@ -92,7 +97,7 @@ static void draw_page( cairo_get_matrix(cr, &m); cairo_scale(cr, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi, Inkscape::Util::Quantity::convert(1, "in", "pt") / dpi); // FIXME: why is the origin offset?? - cairo_set_source_surface(cr, png->cobj(), -16.0, -16.0); + cairo_set_source_surface(cr, png->cobj(), 0, 0); cairo_paint(cr); cairo_set_matrix(cr, &m); } @@ -106,6 +111,7 @@ static void draw_page( } else { // Render as vectors + prefs->setBool("/dialogs/printing/asbitmap", false); Inkscape::Extension::Internal::CairoRenderer renderer; Inkscape::Extension::Internal::CairoRenderContext *ctx = renderer.createContext(); diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp index d6248df69..511b0375c 100644 --- a/src/ui/widget/rendering-options.cpp +++ b/src/ui/widget/rendering-options.cpp @@ -12,6 +12,7 @@ # include #endif +#include "preferences.h" #include "rendering-options.h" #include "util/units.h" #include @@ -38,6 +39,7 @@ RenderingOptions::RenderingOptions () : Glib::ustring(""), Glib::ustring(""), false) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // set up tooltips _radio_vector.set_tooltip_text( _("Render using Cairo vector operations. " @@ -52,15 +54,21 @@ RenderingOptions::RenderingOptions () : set_border_width(2); - // default to vector operations - _radio_vector.set_active (true); Gtk::RadioButtonGroup group = _radio_vector.get_group (); _radio_bitmap.set_group (group); _radio_bitmap.signal_toggled().connect(sigc::mem_fun(*this, &RenderingOptions::_toggled)); - + + // default to vector operations + if (prefs->getBool("/dialogs/printing/asbitmap", false)) { + _radio_bitmap.set_active(); + } else { + _radio_vector.set_active(); + } + // configure default DPI _dpi.setRange(Inkscape::Util::Quantity::convert(1, "in", "pt"),2400.0); - _dpi.setValue(Inkscape::Util::Quantity::convert(1, "in", "pt")); + _dpi.setValue(prefs->getDouble("/dialogs/printing/dpi", + Inkscape::Util::Quantity::convert(1, "in", "pt"))); _dpi.setIncrements(1.0,10.0); _dpi.setDigits(0); _dpi.update(); -- cgit v1.2.3 From 9d5529ca1b43a144f825fc58d6aa37911a4ac7f6 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 13 Aug 2014 09:12:45 -0400 Subject: Fix build (bzr r13510) --- src/libnrtype/font-lister.cpp | 6 +++++ src/libnrtype/font-lister.h | 7 +---- src/ui/dialog/print.cpp | 4 ++- src/ui/widget/rendering-options.cpp | 2 ++ src/widgets/toolbox.cpp | 52 ++++++++++++++++++------------------- 5 files changed, 38 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 43c3045b1..3c21e62e4 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -268,6 +268,12 @@ namespace Inkscape font_list_store->thaw_notify(); } +Inkscape::FontLister* FontLister::get_instance () +{ + static Inkscape::FontLister* instance = new Inkscape::FontLister(); + return instance; +} + void FontLister::update_font_list_recursive( SPObject *r, std::list *l ) { diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index c89dab550..09be16f24 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -149,12 +149,7 @@ namespace Inkscape update_font_list_recursive( SPObject *r, std::list *l ); public: - static Inkscape::FontLister* - get_instance () - { - static Inkscape::FontLister* instance = new Inkscape::FontLister(); - return instance; - } + static Inkscape::FontLister* get_instance (); /** Takes a hand written font spec and returns a Pango generated one in * standard form. diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 4d8d512df..ed39ebb32 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -13,14 +13,16 @@ #ifdef HAVE_CONFIG_H # include #endif + #ifdef WIN32 #include #include #endif +#include + #include "preferences.h" #include "print.h" -#include #include "extension/internal/cairo-render-context.h" #include "extension/internal/cairo-renderer.h" diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp index 511b0375c..837387f7b 100644 --- a/src/ui/widget/rendering-options.cpp +++ b/src/ui/widget/rendering-options.cpp @@ -12,6 +12,8 @@ # include #endif +#include + #include "preferences.h" #include "rendering-options.h" #include "util/units.h" diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 939546f78..c7d72f0b8 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -39,35 +39,35 @@ #include #include -#include "../desktop.h" -#include "../desktop-handles.h" -#include "../desktop-style.h" +#include "desktop.h" +#include "desktop-handles.h" +#include "desktop-style.h" #include "document-undo.h" -#include "../ege-adjustment-action.h" -#include "../ege-output-action.h" -#include "../ege-select-one-action.h" -#include "../graphlayout.h" -#include "../helper/action.h" -#include "../helper/action-context.h" +#include "ege-adjustment-action.h" +#include "ege-output-action.h" +#include "ege-select-one-action.h" +#include "graphlayout.h" +#include "helper/action.h" +#include "helper/action-context.h" #include "icon.h" -#include "../ink-action.h" -#include "../ink-comboboxentry-action.h" -#include "../inkscape.h" -#include "../interface.h" -#include "../shortcuts.h" -#include "../sp-namedview.h" -#include "../tools-switch.h" -#include "../ui/icon-names.h" -#include "../ui/widget/style-swatch.h" -#include "../verbs.h" -#include "../widgets/button.h" -#include "../widgets/spinbutton-events.h" +#include "ink-action.h" +#include "ink-comboboxentry-action.h" +#include "inkscape.h" +#include "interface.h" +#include "shortcuts.h" +#include "sp-namedview.h" +#include "tools-switch.h" +#include "ui/icon-names.h" +#include "ui/widget/style-swatch.h" +#include "verbs.h" +#include "widgets/button.h" +#include "widgets/spinbutton-events.h" #include "ui/widget/spinbutton.h" -#include "../widgets/spw-utilities.h" -#include "../widgets/widget-sizes.h" -#include "../xml/attribute-record.h" -#include "../xml/node-event-vector.h" -#include "../xml/repr.h" +#include "widgets/spw-utilities.h" +#include "widgets/widget-sizes.h" +#include "xml/attribute-record.h" +#include "xml/node-event-vector.h" +#include "xml/repr.h" #include "ui/uxmanager.h" -- cgit v1.2.3 From ce41e6c128161e245d9523c0b0cbbba8e12823c7 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 13 Aug 2014 09:15:28 -0400 Subject: Revert unintentional changes (bzr r13511) --- src/libnrtype/font-lister.cpp | 6 ----- src/libnrtype/font-lister.h | 7 +++++- src/widgets/toolbox.cpp | 52 +++++++++++++++++++++---------------------- 3 files changed, 32 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 3c21e62e4..43c3045b1 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -268,12 +268,6 @@ namespace Inkscape font_list_store->thaw_notify(); } -Inkscape::FontLister* FontLister::get_instance () -{ - static Inkscape::FontLister* instance = new Inkscape::FontLister(); - return instance; -} - void FontLister::update_font_list_recursive( SPObject *r, std::list *l ) { diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index 09be16f24..c89dab550 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -149,7 +149,12 @@ namespace Inkscape update_font_list_recursive( SPObject *r, std::list *l ); public: - static Inkscape::FontLister* get_instance (); + static Inkscape::FontLister* + get_instance () + { + static Inkscape::FontLister* instance = new Inkscape::FontLister(); + return instance; + } /** Takes a hand written font spec and returns a Pango generated one in * standard form. diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index c7d72f0b8..939546f78 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -39,35 +39,35 @@ #include #include -#include "desktop.h" -#include "desktop-handles.h" -#include "desktop-style.h" +#include "../desktop.h" +#include "../desktop-handles.h" +#include "../desktop-style.h" #include "document-undo.h" -#include "ege-adjustment-action.h" -#include "ege-output-action.h" -#include "ege-select-one-action.h" -#include "graphlayout.h" -#include "helper/action.h" -#include "helper/action-context.h" +#include "../ege-adjustment-action.h" +#include "../ege-output-action.h" +#include "../ege-select-one-action.h" +#include "../graphlayout.h" +#include "../helper/action.h" +#include "../helper/action-context.h" #include "icon.h" -#include "ink-action.h" -#include "ink-comboboxentry-action.h" -#include "inkscape.h" -#include "interface.h" -#include "shortcuts.h" -#include "sp-namedview.h" -#include "tools-switch.h" -#include "ui/icon-names.h" -#include "ui/widget/style-swatch.h" -#include "verbs.h" -#include "widgets/button.h" -#include "widgets/spinbutton-events.h" +#include "../ink-action.h" +#include "../ink-comboboxentry-action.h" +#include "../inkscape.h" +#include "../interface.h" +#include "../shortcuts.h" +#include "../sp-namedview.h" +#include "../tools-switch.h" +#include "../ui/icon-names.h" +#include "../ui/widget/style-swatch.h" +#include "../verbs.h" +#include "../widgets/button.h" +#include "../widgets/spinbutton-events.h" #include "ui/widget/spinbutton.h" -#include "widgets/spw-utilities.h" -#include "widgets/widget-sizes.h" -#include "xml/attribute-record.h" -#include "xml/node-event-vector.h" -#include "xml/repr.h" +#include "../widgets/spw-utilities.h" +#include "../widgets/widget-sizes.h" +#include "../xml/attribute-record.h" +#include "../xml/node-event-vector.h" +#include "../xml/repr.h" #include "ui/uxmanager.h" -- cgit v1.2.3 From 9fdd8f25ee0f04d337864c7ec5e3216dae727e3c Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 14 Aug 2014 22:09:10 +0200 Subject: Fix some transformation center regressions, related to the viewbox/units changes (bzr r13512) --- src/selection-chemistry.cpp | 7 ++----- src/sp-item-group.cpp | 8 +------- src/sp-item.cpp | 26 +++++++++++++++++++++----- src/ui/dialog/document-properties.cpp | 7 ++++--- 4 files changed, 28 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index f058189d3..868a9d743 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1621,13 +1621,10 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate); } - // if we're transforming the actual object, not just updating the repr, we can transform the + // if we're moving the actual object, not just updating the repr, we can transform the // center by the same matrix (only necessary for non-translations) if (set_i2d && item->isCenterSet() && !(affine.isTranslation() || affine.isIdentity())) { - // If there's a viewbox, we might have an affine with a translation component; - // we will only apply the scaling/skewing components, not the translations - // because otherwise the center will move relative to the item - item->setCenter(old_center * affine.withoutTranslation()); + item->setCenter(old_center * affine); item->updateRepr(); } } diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 657aca692..bb52b0c55 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -660,12 +660,6 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) Geom::Translate const s(p); Geom::Affine final = s.inverse() * sc * s; - Geom::Point old_center(0,0); - if (item->isCenterSet()) { - item->scaleCenter(sc.inverse()); // Convert the old relative center position to the new coordinates already now - old_center = item->getCenter(); // because getCenter() will use the bbox midpoint, which is also already in the new coordinates - } - gchar const *conn_type = NULL; if (SP_IS_TEXT_TEXTPATH(item)) { SP_TEXT(item)->optimizeTextpathText(); @@ -710,7 +704,7 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) } if (item->isCenterSet() && !(final.isTranslation() || final.isIdentity())) { - item->setCenter(old_center * final); + item->scaleCenter(sc); // All coordinates have been scaled, so also the center must be scaled item->updateRepr(); } } diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 0cacc86b1..428f9555e 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -228,18 +228,25 @@ void SPItem::setExplicitlyHidden(bool val) { } /** - * Sets the transform_center_x and transform_center_y properties to retain the rotation centre - */ + * Sets the transform_center_x and transform_center_y properties to retain the rotation center +*/ void SPItem::setCenter(Geom::Point const &object_centre) { document->ensureUpToDate(); + // Copied from DocumentProperties::onDocUnitChange() + gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); + gdouble viewscale = std::min(viewscale_h, viewscale_w); + // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); if (bbox) { - transform_center_x = object_centre[Geom::X] - bbox->midpoint()[Geom::X]; + // object centre is document coordinates (i.e. in pixels), so we need to consider the viewbox + // to translate to user units; transform_center_x/y is in user units + transform_center_x = (object_centre[Geom::X] - bbox->midpoint()[Geom::X])/viewscale; if (Geom::are_near(transform_center_x, 0)) // rounding error transform_center_x = 0; - transform_center_y = object_centre[Geom::Y] - bbox->midpoint()[Geom::Y]; + transform_center_y = (object_centre[Geom::Y] - bbox->midpoint()[Geom::Y])/viewscale; if (Geom::are_near(transform_center_y, 0)) // rounding error transform_center_y = 0; } @@ -255,16 +262,25 @@ bool SPItem::isCenterSet() const { return (transform_center_x != 0 || transform_center_y != 0); } +// Get the item's transformation center in document coordinates (i.e. in pixels) Geom::Point SPItem::getCenter() const { document->ensureUpToDate(); + // Copied from DocumentProperties::onDocUnitChange() + gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); + gdouble viewscale = std::min(viewscale_h, viewscale_w); + // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); if (bbox) { - return bbox->midpoint() + Geom::Point (transform_center_x, transform_center_y); + // transform_center_x/y are stored in user units, so we have to take the viewbox into account to translate to document coordinates + return bbox->midpoint() + Geom::Point (transform_center_x*viewscale, transform_center_y*viewscale); + } else { return Geom::Point(0, 0); // something's wrong! } + } void diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 9141b2268..4e4616724 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -45,6 +45,7 @@ #include "widgets/icon.h" #include "xml/node-event-vector.h" #include "xml/repr.h" +#include // std::min #include "rdf.h" #include "ui/widget/entity-entry.h" @@ -1735,9 +1736,9 @@ void DocumentProperties::onDocUnitChange() prefs->setBool("/options/transform/gradient", true); { ShapeEditor::blockSetItem(true); - gdouble viewscale = doc->getWidth().value("px")/doc->getRoot()->viewBox.width(); - if (doc->getHeight().value("px")/doc->getRoot()->viewBox.height() < viewscale) - viewscale = doc->getHeight().value("px")/doc->getRoot()->viewBox.height(); + gdouble viewscale_w = doc->getWidth().value("px")/doc->getRoot()->viewBox.width(); + gdouble viewscale_h = doc->getHeight().value("px")/doc->getRoot()->viewBox.height(); + gdouble viewscale = std::min(viewscale_h, viewscale_w); gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] + (doc->getWidth().value("px") - viewscale*doc->getRoot()->viewBox.width())/2, -- cgit v1.2.3 From 2f2df21d0c1d977644578c74ac466bcb330f71e5 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Thu, 14 Aug 2014 22:27:49 -0700 Subject: Set pre-release version to 0.91pre2 (bzr r13513) --- src/inkscape-x64.rc | 8 ++++---- src/inkscape.rc | 8 ++++---- src/inkview-x64.rc | 8 ++++---- src/inkview.rc | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/inkscape-x64.rc b/src/inkscape-x64.rc index ce286c2ca..47dbcb2bc 100644 --- a/src/inkscape-x64.rc +++ b/src/inkscape-x64.rc @@ -3,8 +3,8 @@ APPLICATION_ICON ICON DISCARDABLE "../inkscape.ico" 1 24 DISCARDABLE "./inkscape-manifest-x64.xml" 1 VERSIONINFO - FILEVERSION 0,48,0,9 - PRODUCTVERSION 0,48,0,9 + FILEVERSION 0,91pre2,0,0 + PRODUCTVERSION 0,91pre2,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -13,11 +13,11 @@ BEGIN VALUE "Comments", "Published under the GNU GPL" VALUE "CompanyName", "inkscape.org" VALUE "FileDescription", "Inkscape" - VALUE "FileVersion", "0.48+devel" + VALUE "FileVersion", "0.91pre2" VALUE "InternalName", "Inkscape" VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkscape" - VALUE "ProductVersion", "0.48+devel" + VALUE "ProductVersion", "0.91pre2" END END BLOCK "VarFileInfo" diff --git a/src/inkscape.rc b/src/inkscape.rc index 395ef39e1..2c2c0112b 100644 --- a/src/inkscape.rc +++ b/src/inkscape.rc @@ -3,8 +3,8 @@ APPLICATION_ICON ICON DISCARDABLE "../inkscape.ico" 1 24 DISCARDABLE "./inkscape-manifest.xml" 1 VERSIONINFO - FILEVERSION 0,48,0,9 - PRODUCTVERSION 0,48,0,9 + FILEVERSION 0,91pre2,0,0 + PRODUCTVERSION 0,91pre2,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -13,11 +13,11 @@ BEGIN VALUE "Comments", "Published under the GNU GPL" VALUE "CompanyName", "inkscape.org" VALUE "FileDescription", "Inkscape" - VALUE "FileVersion", "0.48+devel" + VALUE "FileVersion", "0.91pre2" VALUE "InternalName", "Inkscape" VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkscape" - VALUE "ProductVersion", "0.48+devel" + VALUE "ProductVersion", "0.91pre2" END END BLOCK "VarFileInfo" diff --git a/src/inkview-x64.rc b/src/inkview-x64.rc index 2de16060b..f23fe84c9 100644 --- a/src/inkview-x64.rc +++ b/src/inkview-x64.rc @@ -3,8 +3,8 @@ APPLICATION_ICON ICON DISCARDABLE "../inkscape.ico" 1 24 DISCARDABLE "./inkview-manifest-x64.xml" 1 VERSIONINFO - FILEVERSION 0,48,0,9 - PRODUCTVERSION 0,48,0,9 + FILEVERSION 0,91,0,0 + PRODUCTVERSION 0,91,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -13,11 +13,11 @@ BEGIN VALUE "Comments", "Published under the GNU GPL" VALUE "CompanyName", "inkscape.org" VALUE "FileDescription", "Inkview" - VALUE "FileVersion", "0.48+devel" + VALUE "FileVersion", "0.91pre2" VALUE "InternalName", "Inkview" VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkview" - VALUE "ProductVersion", "0.48+devel" + VALUE "ProductVersion", "0.91pre2" END END BLOCK "VarFileInfo" diff --git a/src/inkview.rc b/src/inkview.rc index fd7eb50a1..efbe2568b 100644 --- a/src/inkview.rc +++ b/src/inkview.rc @@ -3,8 +3,8 @@ APPLICATION_ICON ICON DISCARDABLE "../inkscape.ico" 1 24 DISCARDABLE "./inkview-manifest.xml" 1 VERSIONINFO - FILEVERSION 0,48,0,9 - PRODUCTVERSION 0,48,0,9 + FILEVERSION 0,91pre2,0,0 + PRODUCTVERSION 0,91pre2,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -13,11 +13,11 @@ BEGIN VALUE "Comments", "Published under the GNU GPL" VALUE "CompanyName", "inkscape.org" VALUE "FileDescription", "Inkview" - VALUE "FileVersion", "0.48+devel" + VALUE "FileVersion", "0.91pre2" VALUE "InternalName", "Inkview" VALUE "LegalCopyright", "© 2014 Inkscape" VALUE "ProductName", "Inkview" - VALUE "ProductVersion", "0.48+devel" + VALUE "ProductVersion", "0.91pre2" END END BLOCK "VarFileInfo" -- cgit v1.2.3 From 940176d1a9959328f186cb21c22bf43d4cfed4fc Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 15 Aug 2014 08:43:45 +0200 Subject: Preferences. Fix for Bug #184499 (Inkscape Preferences dialog does not remember tabs/pages). Fixed bugs: - https://launchpad.net/bugs/184499 (bzr r13517) --- src/ui/dialog/inkscape-preferences.cpp | 8 ++++++-- src/ui/dialog/inkscape-preferences.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index f1a29e971..5d065dc60 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -76,7 +76,8 @@ InkscapePreferences::InkscapePreferences() : UI::Widget::Panel ("", "/dialogs/preferences", SP_VERB_DIALOG_DISPLAY), _max_dialog_width(0), _max_dialog_height(0), - _current_page(0) + _current_page(0), + _init(true) { //get the width of a spinbutton Inkscape::UI::Widget::SpinButton* sb = new Inkscape::UI::Widget::SpinButton; @@ -2000,6 +2001,7 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) Gtk::TreeModel::Row row = *iter; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int desired_page = prefs->getInt("/dialogs/preferences/page", 0); + _init = false; if (desired_page == row[_page_list_columns._col_id]) { if (desired_page >= PREFS_PAGE_TOOLS && desired_page <= PREFS_PAGE_TOOLS_CONNECTOR) @@ -2049,7 +2051,9 @@ void InkscapePreferences::on_pagelist_selection_changed() Gtk::TreeModel::Row row = *iter; _current_page = row[_page_list_columns._col_page]; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/dialogs/preferences/page", row[_page_list_columns._col_id]); + if (!_init) { + prefs->setInt("/dialogs/preferences/page", row[_page_list_columns._col_id]); + } _page_title.set_markup("" + row[_page_list_columns._col_name] + ""); _page_frame.add(*_current_page); _current_page->show(); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 1c2151605..9f37626ed 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -532,6 +532,7 @@ private: InkscapePreferences(); InkscapePreferences(InkscapePreferences const &d); InkscapePreferences operator=(InkscapePreferences const &d); + bool _init; }; } // namespace Dialog -- cgit v1.2.3 From f0d21a859fd6c3594e46339030e7209e0138da04 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 15 Aug 2014 15:11:41 +0200 Subject: suppress compiler warning (bzr r13519) --- src/sp-solid-color.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp-solid-color.cpp b/src/sp-solid-color.cpp index 1f606d176..9f6692f98 100644 --- a/src/sp-solid-color.cpp +++ b/src/sp-solid-color.cpp @@ -72,7 +72,7 @@ Inkscape::XML::Node* SPSolidColor::write(Inkscape::XML::Document* xml_doc, Inksc return repr; } -cairo_pattern_t* SPSolidColor::pattern_new(cairo_t * /*ct*/, Geom::OptRect const &bbox, double opacity) { +cairo_pattern_t* SPSolidColor::pattern_new(cairo_t * /*ct*/, Geom::OptRect const & /*bbox*/, double opacity) { SPIColor *c = &(this->style->solid_color); cairo_pattern_t *cp = cairo_pattern_create_rgba ( c->value.color.v.c[0], c->value.color.v.c[1], c->value.color.v.c[2], SP_SCALE24_TO_FLOAT(this->style->solid_opacity.value) * opacity ); -- cgit v1.2.3 From ab9df1bf462c32d785e0b146228d5711a0599114 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 15 Aug 2014 15:14:32 +0200 Subject: memleak fix (Bug #1293827: LivePathEffect memory leak ) (bzr r13520) --- src/live_effects/parameter/parameter.cpp | 8 +++++++- src/live_effects/parameter/parameter.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp index a5de2169e..ad2960cd9 100644 --- a/src/live_effects/parameter/parameter.cpp +++ b/src/live_effects/parameter/parameter.cpp @@ -36,13 +36,19 @@ Parameter::Parameter( const Glib::ustring& label, const Glib::ustring& tip, { } - void Parameter::param_write_to_repr(const char * svgd) { param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); } +void Parameter::write_to_SVG(void) +{ + gchar * str = param_getSVGValue(); + param_write_to_repr(str); + g_free(str); +} + /*########################################### * REAL PARAM */ diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 785ada92e..2e6cae49f 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -49,7 +49,7 @@ public: virtual bool param_readSVGValue(const gchar * strvalue) = 0; // returns true if new value is valid / accepted. virtual gchar * param_getSVGValue() const = 0; - void write_to_SVG() { param_write_to_repr(param_getSVGValue()); } + void write_to_SVG(); virtual void param_set_default() = 0; -- cgit v1.2.3 From 13db4e8d7c2250a8b5a88beca4a5800ef90b7f54 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 16 Aug 2014 22:54:37 +0200 Subject: Fix shift of transformation center on pasting Fixed bugs: - https://launchpad.net/bugs/1247799 (bzr r13521) --- src/file.cpp | 6 +++--- src/selection-chemistry.cpp | 14 ++++++++------ src/selection-chemistry.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 51e629c7d..580c93c9e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1087,9 +1087,9 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place) Inkscape::Selection *selection = sp_desktop_selection(desktop); selection->setReprList(pasted_objects); - // invers apply parent transform + // Apply inverse of parent transform Geom::Affine doc2parent = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse(); - sp_selection_apply_affine(selection, desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false); + sp_selection_apply_affine(selection, desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false, false); // Update (among other things) all curves in paths, for bounds() to work target_document->ensureUpToDate(); @@ -1226,7 +1226,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // c2p is identity matrix at this point unless ensureUpToDate is called doc->ensureUpToDate(); Geom::Affine affine = doc->getRoot()->c2p * SP_ITEM(place_to_insert)->i2doc_affine().inverse(); - sp_selection_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false); + sp_selection_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false, false); // move to mouse pointer { diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 868a9d743..01ce20509 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1466,7 +1466,7 @@ value of set_i2d==false is only used by seltrans when it's dragging objects live that case, items are already in the new position, but the repr is in the old, and this function then simply updates the repr from item->transform. */ -void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine const &affine, bool set_i2d, bool compensate) +void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine const &affine, bool set_i2d, bool compensate, bool adjust_transf_center) { if (selection->isEmpty()) return; @@ -1621,11 +1621,13 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate); } - // if we're moving the actual object, not just updating the repr, we can transform the - // center by the same matrix (only necessary for non-translations) - if (set_i2d && item->isCenterSet() && !(affine.isTranslation() || affine.isIdentity())) { - item->setCenter(old_center * affine); - item->updateRepr(); + if (adjust_transf_center) { // The transformation center should not be touched in case of pasting or importing, which is allowed by this if clause + // if we're moving the actual object, not just updating the repr, we can transform the + // center by the same matrix (only necessary for non-translations) + if (set_i2d && item->isCenterSet() && !(affine.isTranslation() || affine.isIdentity())) { + item->setCenter(old_center * affine); + item->updateRepr(); + } } } } diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h index d76a67a9d..01c35d65a 100644 --- a/src/selection-chemistry.h +++ b/src/selection-chemistry.h @@ -104,7 +104,7 @@ void sp_selection_to_next_layer( SPDesktop *desktop, bool suppressDone = false ) void sp_selection_to_prev_layer( SPDesktop *desktop, bool suppressDone = false ); void sp_selection_to_layer( SPDesktop *desktop, SPObject *layer, bool suppressDone = false ); -void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine const &affine, bool set_i2d = true, bool compensate = true); +void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine const &affine, bool set_i2d = true, bool compensate = true, bool adjust_transf_center = true); void sp_selection_remove_transform (SPDesktop *desktop); void sp_selection_scale_absolute (Inkscape::Selection *selection, double x0, double x1, double y0, double y1); void sp_selection_scale_relative(Inkscape::Selection *selection, Geom::Point const &align, Geom::Scale const &scale); -- cgit v1.2.3 From 38b8b56f7a45878b6aea857f8bcc15064f44200d Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 16 Aug 2014 20:23:01 -0400 Subject: Fix grid jumping (bug #1342238). Fixed bugs: - https://launchpad.net/bugs/1342238 (bzr r13522) --- src/display/canvas-axonomgrid.cpp | 3 +++ src/util/units.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 312a8d655..592c962a6 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -387,6 +387,9 @@ _wr.setUpdating (false); _rcp_gmcol->setRgba32 (empcolor); _rsi->setValue (empspacing); + _rsu_ox->setProgrammatically = false; + _rsu_oy->setProgrammatically = false; + return table; } diff --git a/src/util/units.cpp b/src/util/units.cpp index d2053f60b..eb4a313e0 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -291,11 +291,15 @@ Quantity UnitTable::parseQuantity(Glib::ustring const &q) const std::istringstream tmp_v(match_info.fetch(0)); tmp_v >> value; } + int start_pos, end_pos; + match_info.fetch_pos(0, end_pos, start_pos); + end_pos = q.size() - start_pos; + Glib::ustring u = q.substr(start_pos, end_pos); // Extract unit abbreviation Glib::ustring abbr; Glib::RefPtr unit_regex = Glib::Regex::create("[A-z%]+"); - if (unit_regex->match(q, match_info)) { + if (unit_regex->match(u, match_info)) { abbr = match_info.fetch(0); } -- cgit v1.2.3 From 06b2a7b43586148d32f546ad82e6a47ba2a597fd Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sat, 16 Aug 2014 22:43:35 -0400 Subject: Work around for upstream GTK bug #734915 (speeds launch times) (bzr r13523) --- src/ink-comboboxentry-action.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ink-comboboxentry-action.cpp b/src/ink-comboboxentry-action.cpp index ebd238edc..6579c8ff8 100644 --- a/src/ink-comboboxentry-action.cpp +++ b/src/ink-comboboxentry-action.cpp @@ -383,6 +383,15 @@ GtkWidget* create_tool_item( GtkAction* action ) g_signal_connect( G_OBJECT(comboBoxEntry), "changed", G_CALLBACK(combo_box_changed_cb), action ); + // Optionally add separator function... + if( ink_comboboxentry_action->separator_func != NULL ) { + gtk_combo_box_set_row_separator_func( ink_comboboxentry_action->combobox, + GtkTreeViewRowSeparatorFunc (ink_comboboxentry_action->separator_func), + NULL, NULL ); + } + + gtk_widget_show_all (comboBoxEntry); + // Optionally add formatting... if( ink_comboboxentry_action->cell_data_func != NULL ) { GtkCellRenderer *cell = gtk_cell_renderer_text_new(); @@ -393,13 +402,6 @@ GtkWidget* create_tool_item( GtkAction* action ) NULL, NULL ); } - // Optionally add separator function... - if( ink_comboboxentry_action->separator_func != NULL ) { - gtk_combo_box_set_row_separator_func( ink_comboboxentry_action->combobox, - GtkTreeViewRowSeparatorFunc (ink_comboboxentry_action->separator_func), - NULL, NULL ); - } - // Optionally widen the combobox width... which widens the drop-down list in list mode. if( ink_comboboxentry_action->extra_width > 0 ) { GtkRequisition req; -- cgit v1.2.3 From ad180652b5f6b59b3f24d60677bbf8ec97827aed Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 17 Aug 2014 10:33:11 -0400 Subject: Similar workaround to r13523 (text&font dialog not appearing quickly) (bzr r13525) --- src/widgets/font-selector.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index ccaf93e55..f00f05768 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -157,6 +157,10 @@ static void sp_font_selector_init(SPFontSelector *fsel) gtk_container_add(GTK_CONTAINER(f), sw); fsel->family_treeview = gtk_tree_view_new (); + gtk_tree_view_set_row_separator_func( GTK_TREE_VIEW(fsel->family_treeview), + GtkTreeViewRowSeparatorFunc ((gpointer)font_lister_separator_func), + NULL, NULL ); + gtk_widget_show_all(GTK_WIDGET (fsel->family_treeview)); GtkTreeViewColumn *column = gtk_tree_view_column_new (); GtkCellRenderer *cell = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_start (column, cell, FALSE); @@ -166,9 +170,6 @@ static void sp_font_selector_init(SPFontSelector *fsel) NULL, NULL ); gtk_tree_view_append_column (GTK_TREE_VIEW(fsel->family_treeview), column); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(fsel->family_treeview), FALSE); - gtk_tree_view_set_row_separator_func( GTK_TREE_VIEW(fsel->family_treeview), - GtkTreeViewRowSeparatorFunc ((gpointer)font_lister_separator_func), - NULL, NULL ); /* Muck with style, see text-toolbar.cpp */ gtk_widget_set_name( GTK_WIDGET(fsel->family_treeview), "font_selector_family" ); -- cgit v1.2.3