summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-01-24 09:58:32 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-01-24 09:58:32 +0000
commite670856c8810c2733ce95e5f31c822cf20030367 (patch)
treeff3d2c135a871bf5a66a066ee8bd58fa602559cd /src
parentAdded the remove for outer staff to kaleidoscope (diff)
parent* [INTL:sk] Slovak translation update (diff)
downloadinkscape-e670856c8810c2733ce95e5f31c822cf20030367.tar.gz
inkscape-e670856c8810c2733ce95e5f31c822cf20030367.zip
update to trunk
(bzr r13708.1.13)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp2
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp7
-rw-r--r--src/sp-guide.cpp22
-rw-r--r--src/ui/clipboard.cpp7
-rw-r--r--src/ui/widget/registered-widget.cpp5
5 files changed, 28 insertions, 15 deletions
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/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 1c01e2aaf..35b5c1eb2 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -15,17 +15,10 @@
#include <gdk/gdk.h>
#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 <cmath>
#include "knot-holder-entity.h"
#include "knotholder.h"
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/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;
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;