From 167d466507a24463eb49ef0efd215dab3d00dd03 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 21 Jan 2015 00:46:47 +0100 Subject: Remove unnecesary headers from rotate curves (bzr r13866) --- src/live_effects/lpe-copy_rotate.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index 3428ba8b3..0fa2ebedc 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -15,17 +15,10 @@ #include #include "live_effects/lpe-copy_rotate.h" -#include "sp-shape.h" -#include "display/curve.h" -#include <2geom/path.h> -#include <2geom/path-intersection.h> -#include <2geom/sbasis-to-bezier.h> #include <2geom/path.h> #include <2geom/transforms.h> #include <2geom/d2-sbasis.h> #include <2geom/angle.h> -#include <2geom/line.h> -#include #include "knot-holder-entity.h" #include "knotholder.h" -- cgit v1.2.3 From d6c1f073a54e1901783415fe1890b2370fbdca05 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 21 Jan 2015 11:13:17 +0100 Subject: Fix regression: pasted bitmaps should be embeded. (Bug #855440) (bzr r13867) --- src/extension/internal/gdkpixbuf-input.cpp | 2 +- src/ui/clipboard.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 04a446d1c..f5fab1fa2 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -135,7 +135,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) // Set viewBox if it doesn't exist if (!doc->getRoot()->viewBox_set) { - std::cout << "Viewbox not set, setting" << std::endl; + // std::cerr << "Viewbox not set, setting" << std::endl; doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit()))); } diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index dabebe1be..94a1eb2dc 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -936,15 +936,18 @@ bool ClipboardManagerImpl::_pasteImage(SPDocument *doc) } Inkscape::Extension::Extension *png = *i; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Glib::ustring attr = prefs->getString("/dialogs/import/link"); + Glib::ustring attr_saved = prefs->getString("/dialogs/import/link"); + bool ask_saved = prefs->getBool("/dialogs/import/ask"); prefs->setString("/dialogs/import/link", "embed"); + prefs->setBool("/dialogs/import/ask", false); png->set_gui(false); gchar *filename = g_build_filename( g_get_tmp_dir(), "inkscape-clipboard-import", NULL ); img->save(filename, "png"); file_import(doc, filename, png); g_free(filename); - prefs->setString("/dialogs/import/link", attr); + prefs->setString("/dialogs/import/link", attr_saved); + prefs->setBool("/dialogs/import/ask", ask_saved); png->set_gui(true); return true; -- cgit v1.2.3 From 4b34a53a8122919e53ce2e13627e2007fafec0db Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Fri, 23 Jan 2015 15:39:50 -0500 Subject: improved precision in placing grids and guides. (Bug 1373311) Fixed bugs: - https://launchpad.net/bugs/1373311 (bzr r13868) --- src/sp-guide.cpp | 22 ++++++++++++++++++---- src/ui/widget/registered-widget.cpp | 5 ++++- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 3eecb2783..890c1f597 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -198,8 +198,15 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P SPRoot *root = doc->getRoot(); if( root->viewBox_set ) { - newx = newx * root->viewBox.width() / root->width.computed; - newy = newy * root->viewBox.height() / root->height.computed; + // check to see if scaling is uniform + if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) { + double px2vbunit = (root->viewBox.width()/root->width.computed + root->viewBox.height()/root->height.computed)/2.0; + newx = newx * px2vbunit; + newy = newy * px2vbunit; + } else { + newx = newx * root->viewBox.width() / root->width.computed; + newy = newy * root->viewBox.height() / root->height.computed; + } } sp_repr_set_point(repr, "position", Geom::Point( newx, newy )); @@ -341,8 +348,15 @@ void SPGuide::moveto(Geom::Point const point_on_line, bool const commit) SPRoot *root = document->getRoot(); if( root->viewBox_set ) { - newx = newx * root->viewBox.width() / root->width.computed; - newy = newy * root->viewBox.height() / root->height.computed; + // check to see if scaling is uniform + if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) { + double px2vbunit = (root->viewBox.width()/root->width.computed + root->viewBox.height()/root->height.computed)/2.0; + newx = newx * px2vbunit; + newy = newy * px2vbunit; + } else { + newx = newx * root->viewBox.width() / root->width.computed; + newy = newy * root->viewBox.height() / root->height.computed; + } } //XML Tree being used here directly while it shouldn't be. diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index bbf542987..298377af3 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -245,7 +245,10 @@ RegisteredScalarUnit::on_value_changed() if (doc) { SPRoot *root = doc->getRoot(); if (root->viewBox_set) { - if (_user_units == RSU_x) { + // check to see if scaling is uniform + if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) { + scale = (root->viewBox.width() / root->width.computed + root->viewBox.height() / root->height.computed)/2.0; + } else if (_user_units == RSU_x) { scale = root->viewBox.width() / root->width.computed; } else { scale = root->viewBox.height() / root->height.computed; -- cgit v1.2.3