summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-06 18:38:03 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-06 18:38:03 +0000
commite747c89c1d1579d2dd478bfcdc448efd09438371 (patch)
tree706654eeabb6c28af7dc93463f2ad9b75b564cfc
parentFix bug #1241501, improve tooltip text on path parameter (diff)
parentFix for bug #1327267 (excessive calls to sp_style_read_from_prefs) (diff)
downloadinkscape-e747c89c1d1579d2dd478bfcdc448efd09438371.tar.gz
inkscape-e747c89c1d1579d2dd478bfcdc448efd09438371.zip
Update to trunk r13497
(bzr r13341.1.119)
-rw-r--r--src/2geom/svg-path-parser.cpp37
-rw-r--r--src/document-undo.cpp1
-rw-r--r--src/sp-item.cpp1
-rw-r--r--src/sp-item.h3
-rw-r--r--src/sp-star.cpp8
-rw-r--r--src/widgets/text-toolbar.cpp45
6 files changed, 42 insertions, 53 deletions
diff --git a/src/2geom/svg-path-parser.cpp b/src/2geom/svg-path-parser.cpp
index ccc383920..932f95829 100644
--- a/src/2geom/svg-path-parser.cpp
+++ b/src/2geom/svg-path-parser.cpp
@@ -1,5 +1,3 @@
-
-#line 1 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
/**
* \file
* \brief parse SVG path specifications
@@ -130,6 +128,9 @@ private:
void _arcTo(double rx, double ry, double angle,
bool large_arc, bool sweep, Point p)
{
+ if (are_near(_current, p)) {
+ return;
+ }
_quad_tangent = _cubic_tangent = _current = p;
_sink.arcTo(rx, ry, angle, large_arc, sweep, p);
}
@@ -141,7 +142,6 @@ private:
};
-#line 145 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.cpp"
static const char _svg_path_actions[] = {
0, 1, 0, 1, 1, 1, 2, 1,
3, 1, 4, 1, 5, 1, 15, 1,
@@ -1147,9 +1147,6 @@ static const int svg_path_first_final = 270;
//static const int svg_path_en_main = 1;
-#line 144 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
-
-
void Parser::parse(char const *str)
throw(SVGPathParseError)
{
@@ -1159,13 +1156,11 @@ throw(SVGPathParseError)
_reset();
-
-#line 1164 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.cpp"
{
cs = svg_path_start;
}
-#line 1169 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.cpp"
+
{
int _klen;
unsigned int _trans;
@@ -1238,13 +1233,12 @@ _match:
switch ( *_acts++ )
{
case 0:
-#line 156 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
start = p;
}
break;
case 1:
-#line 160 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
+
{
char const *end=p;
std::string buf(start, end);
@@ -1253,55 +1247,49 @@ _match:
}
break;
case 2:
-#line 167 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
+
{
_push(1.0);
}
break;
case 3:
-#line 171 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
+
{
_push(0.0);
}
break;
case 4:
-#line 175 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
+
{
_absolute = true;
}
break;
case 5:
-#line 179 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_absolute = false;
}
break;
case 6:
-#line 183 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_moveTo(_pop_point());
}
break;
case 7:
-#line 187 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_lineTo(_pop_point());
}
break;
case 8:
-#line 191 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_hlineTo(Point(_pop_coord(X), _current[Y]));
}
break;
case 9:
-#line 195 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_vlineTo(Point(_current[X], _pop_coord(Y)));
}
break;
case 10:
-#line 199 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
Point p = _pop_point();
Point c1 = _pop_point();
@@ -1310,7 +1298,6 @@ _match:
}
break;
case 11:
-#line 206 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
Point p = _pop_point();
Point c1 = _pop_point();
@@ -1318,7 +1305,6 @@ _match:
}
break;
case 12:
-#line 212 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
Point p = _pop_point();
Point c = _pop_point();
@@ -1326,14 +1312,12 @@ _match:
}
break;
case 13:
-#line 218 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
Point p = _pop_point();
_quadTo(_quad_tangent, p);
}
break;
case 14:
-#line 223 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
Point point = _pop_point();
bool sweep = _pop_flag();
@@ -1346,16 +1330,13 @@ _match:
}
break;
case 15:
-#line 234 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{
_closePath();
}
break;
case 16:
-#line 370 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
{{p++; goto _out; }}
break;
-#line 1359 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.cpp"
}
}
@@ -1367,8 +1348,6 @@ _again:
_out: {}
}
-#line 380 "/home/tweenk/src/lib2geom/src/2geom/svg-path-parser.rl"
-
if ( cs < svg_path_first_final ) {
throw SVGPathParseError();
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 39c8a04a0..53e701648 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -255,6 +255,7 @@ gboolean Inkscape::DocumentUndo::undo(SPDocument *doc)
Inkscape::Event *log=(Inkscape::Event *)doc->priv->undo->data;
doc->priv->undo = g_slist_remove (doc->priv->undo, log);
sp_repr_undo_log (log->event);
+ doc->_updateDocument();
doc->priv->redo = g_slist_prepend (doc->priv->redo, log);
doc->setModifiedSinceSave();
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 780845deb..0cacc86b1 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -778,6 +778,7 @@ Geom::OptRect SPItem::visualBounds(Geom::Affine const &transform) const
bbox = const_cast<SPItem*>(this)->bbox(transform, SPItem::VISUAL_BBOX);
}
if (clip_ref->getObject()) {
+ SP_ITEM(clip_ref->getOwner())->bbox_valid = FALSE; // LP Bug 1349018
bbox.intersectWith(SP_CLIPPATH(clip_ref->getObject())->geometricBounds(transform));
}
diff --git a/src/sp-item.h b/src/sp-item.h
index 2880f4a8e..15784d041 100644
--- a/src/sp-item.h
+++ b/src/sp-item.h
@@ -51,7 +51,8 @@ enum {
SP_EVENT_MOUSEOUT
};
-// TODO fix this
+// TODO make a completely new function that transforms either the fill or
+// stroke of any SPItem without adding an extra parameter to adjust_pattern.
enum PatternTransform {
TRANSFORM_BOTH,
TRANSFORM_FILL,
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index eac33ed7b..712029468 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -513,10 +513,12 @@ void SPStar::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::
}
}
-Geom::Affine SPStar::set_transform(Geom::Affine const &xform)
+Geom::Affine SPStar::set_transform(Geom::Affine const &tform)
{
+ Geom::Affine xform = (randomized == 0 ? tform.withoutTranslation() : tform);
+
// Only set transform with proportional scaling
- if (!xform.withoutTranslation().isUniformScale()) {
+ if (!xform.isUniformScale()) {
return xform;
}
@@ -530,7 +532,7 @@ Geom::Affine SPStar::set_transform(Geom::Affine const &xform)
/* This function takes care of translation and scaling, we return whatever parts we can't
handle. */
- Geom::Affine ret(Geom::Affine(xform).withoutTranslation());
+ Geom::Affine ret(xform);
gdouble const s = hypot(ret[0], ret[1]);
if (s > 1e-9) {
ret[0] /= s;
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 64a7cd5e7..36a151c52 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -31,7 +31,6 @@
#include "libnrtype/font-lister.h"
#include <glibmm/i18n.h>
#include "text-toolbar.h"
-#include "connection-pool.h"
#include "desktop-handles.h"
#include "desktop-style.h"
#include "desktop.h"
@@ -54,6 +53,7 @@
#include "toolbox.h"
#include "ui/icon-names.h"
#include "ui/tools/text-tool.h"
+#include "ui/tools/tool-base.h"
#include "verbs.h"
#include "xml/repr.h"
@@ -1200,6 +1200,7 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p
selection->setList(selectList);
}
+static void text_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder);
// Define all the "widgets" in the toolbar.
void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder)
@@ -1622,31 +1623,35 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
// Is this necessary to call? Shouldn't hurt.
sp_text_toolbox_selection_changed(sp_desktop_selection(desktop), holder);
- // Watch selection
- Inkscape::ConnectionPool* pool = Inkscape::ConnectionPool::new_connection_pool ("ISTextToolboxGTK");
-
- sigc::connection *c_selection_changed =
- new sigc::connection (sp_desktop_selection (desktop)->connectChanged
- (sigc::bind (sigc::ptr_fun (sp_text_toolbox_selection_changed), holder)));
- pool->add_connection ("selection-changed", c_selection_changed);
-
- sigc::connection *c_selection_modified =
- new sigc::connection (sp_desktop_selection (desktop)->connectModified
- (sigc::bind (sigc::ptr_fun (sp_text_toolbox_selection_modified), holder)));
- pool->add_connection ("selection-modified", c_selection_modified);
-
- sigc::connection *c_subselection_changed =
- new sigc::connection (desktop->connectToolSubselectionChanged
- (sigc::bind (sigc::ptr_fun (sp_text_toolbox_subselection_changed), holder)));
- pool->add_connection ("tool-subselection-changed", c_subselection_changed);
-
- Inkscape::ConnectionPool::connect_destroy (G_OBJECT (holder), pool);
+ desktop->connectEventContextChanged(sigc::bind(sigc::ptr_fun(text_toolbox_watch_ec), holder));
g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder );
}
+static void text_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder) {
+ using sigc::connection;
+ using sigc::bind;
+ using sigc::ptr_fun;
+ static connection c_selection_changed;
+ static connection c_selection_modified;
+ static connection c_subselection_changed;
+
+ if (SP_IS_TEXT_CONTEXT(ec)) {
+ // Watch selection
+ c_selection_changed = sp_desktop_selection(desktop)->connectChanged(bind(ptr_fun(sp_text_toolbox_selection_changed), holder));
+ c_selection_modified = sp_desktop_selection (desktop)->connectModified(bind(ptr_fun(sp_text_toolbox_selection_modified), holder));
+ c_subselection_changed = desktop->connectToolSubselectionChanged(bind(ptr_fun(sp_text_toolbox_subselection_changed), holder));
+ } else {
+ if (c_selection_changed)
+ c_selection_changed.disconnect();
+ if (c_selection_modified)
+ c_selection_modified.disconnect();
+ if (c_subselection_changed)
+ c_subselection_changed.disconnect();
+ }
+}
/*
Local Variables:
mode:c++