summaryrefslogtreecommitdiffstats
path: root/src/ui
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/ui
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/ui')
-rw-r--r--src/ui/clipboard.cpp7
-rw-r--r--src/ui/widget/registered-widget.cpp5
2 files changed, 9 insertions, 3 deletions
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;