summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-14 22:33:43 +0000
committerJabiertxof <jtx@jtx>2017-01-14 22:33:43 +0000
commitb9df198f666e6efc79a603d2d0bf276c8ab1d6b4 (patch)
tree82d31550313a81c746bf6cce75a87827911a3709 /src
parentUpdate to trunk (diff)
parent[Bug #1654892] Few typos in Calligraphy tutorial. (diff)
downloadinkscape-b9df198f666e6efc79a603d2d0bf276c8ab1d6b4.tar.gz
inkscape-b9df198f666e6efc79a603d2d0bf276c8ab1d6b4.zip
Update to trunk
(bzr r15295.1.62)
Diffstat (limited to 'src')
-rw-r--r--src/color-profile.cpp2
-rw-r--r--src/display/cairo-utils.cpp2
-rw-r--r--src/display/snap-indicator.cpp4
-rw-r--r--src/file.cpp64
-rw-r--r--src/inkscape.cpp2
-rw-r--r--src/io/sys.cpp2
-rw-r--r--src/live_effects/lpe-transform_2pts.cpp14
-rw-r--r--src/live_effects/lpe-transform_2pts.h2
-rw-r--r--src/live_effects/parameter/originalpath.cpp2
-rw-r--r--src/live_effects/parameter/originalpatharray.cpp2
-rw-r--r--src/sp-image.cpp2
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp2
-rw-r--r--src/ui/widget/registered-widget.h2
14 files changed, 83 insertions, 23 deletions
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<std::pair<Glib::ustring, bool> > 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/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);
}
}
}
diff --git a/src/file.cpp b/src/file.cpp
index 756bc55bb..9e96361c3 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,31 @@ 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) {
+
+ // 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) );
+ 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 +573,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 +695,45 @@ 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) {
+
+ 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 );
+ 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 {
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/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<Geom::D2<Geom::SBasis> > 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;
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();
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/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<Geom::Point> 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);
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<gchar *>(
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));
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
}
};