summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac15
-rw-r--r--po/POTFILES.in3
-rw-r--r--share/extensions/seamless_pattern.svg6
-rw-r--r--src/Makefile.am1
-rw-r--r--src/attributes.cpp1
-rw-r--r--src/attributes.h1
-rw-r--r--src/libgdl/gdl-dock-item-grip.c3
-rw-r--r--src/libgdl/gdl-dock-item.c3
-rw-r--r--src/live_effects/CMakeLists.txt2
-rw-r--r--src/live_effects/Makefile_insert2
-rw-r--r--src/live_effects/effect-enum.h1
-rw-r--r--src/live_effects/effect.cpp5
-rw-r--r--src/live_effects/lpe-bspline.cpp83
-rw-r--r--src/live_effects/lpe-transform_2pts.cpp320
-rw-r--r--src/live_effects/lpe-transform_2pts.h80
-rw-r--r--src/sp-factory.cpp2
-rw-r--r--src/sp-guide.cpp7
-rw-r--r--src/sp-namedview.cpp12
-rw-r--r--src/sp-paint-server.cpp4
19 files changed, 465 insertions, 86 deletions
diff --git a/configure.ac b/configure.ac
index aeda9981d..79346551e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -899,21 +899,6 @@ if test "x$enable_strict_build" = "xhigh"; then
CPPFLAGS="-Werror=deprecated-declarations $CPPFLAGS"
fi
-# Check for Apple Mac OS X Carbon framework
-carbon_ok=no
-AC_MSG_CHECKING([for Mac OS X Carbon support])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <Carbon/Carbon.h>
-#include <CoreServices/CoreServices.h>]], [])
-], [carbon_ok=yes])
-AC_MSG_RESULT($carbon_ok)
-if test "x$carbon_ok" = "xyes"; then
- AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
- CARBON_LDFLAGS="-framework Carbon"
- AC_SUBST(CARBON_LDFLAGS)
-fi
-AM_CONDITIONAL(HAVE_CARBON, test "x$carbon_ok" = "xyes")
-
# Check for some boost header files
AC_CHECK_HEADERS([boost/concept_check.hpp], [], AC_MSG_ERROR([You need the boost package (e.g. libboost-dev)]))
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c06960041..894f59f2e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
-# Generated by ./generate_POTFILES.sh at Thu May 21 04:26:44 CEST 2015
+# Generated by ./generate_POTFILES.sh at Mon Aug 24 22:47:33 CEST 2015
[encoding: UTF-8]
inkscape.desktop.in
share/filters/filters.svg.h
@@ -157,6 +157,7 @@ src/live_effects/lpe-show_handles.cpp
src/live_effects/lpe-simplify.cpp
src/live_effects/lpe-sketch.cpp
src/live_effects/lpe-taperstroke.cpp
+src/live_effects/lpe-transform_2pts.cpp
src/live_effects/lpe-vonkoch.cpp
src/live_effects/parameter/bool.cpp
src/live_effects/parameter/enum.h
diff --git a/share/extensions/seamless_pattern.svg b/share/extensions/seamless_pattern.svg
index 729d8cf94..d81460701 100644
--- a/share/extensions/seamless_pattern.svg
+++ b/share/extensions/seamless_pattern.svg
@@ -2,7 +2,7 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="100px" height="100px" viewBox="0 0 100 100" id="SVGRoot" version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="seamless_pattern.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96" enable-background="new">
-<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.93166" inkscape:cx="80.27015" inkscape:cy="164.9834" inkscape:document-units="px" inkscape:current-layer="designBottom" showgrid="false" units="px" inkscape:window-width="1280" inkscape:window-height="960" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" borderlayer="true" />
+<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.93166" inkscape:cx="80.27015" inkscape:cy="164.9834" inkscape:document-units="px" inkscape:current-layer="patternLayer" showgrid="false" units="px" inkscape:window-width="1280" inkscape:window-height="960" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" borderlayer="true" />
<defs id="defs4">
<pattern inkscape:stockid="Checkerboard" id="Checkerboard" patternTransform="translate(0,0) scale(10,10)" height="2" width="2" patternUnits="userSpaceOnUse" inkscape:collect="always">
<rect id="rect12513" height="1" width="1" y="0" x="0" style="fill:black;stroke:none" />
@@ -23,7 +23,7 @@
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-<dc:title></dc:title>
+<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -82,7 +82,7 @@
</g>
<g id="infoGroup" sodipodi:insensitive="true">
<text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.6686153px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:Verdana;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" x="-326.82172" y="-349.80621" id="text8664" sodipodi:linespacing="125%"><tspan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold'" sodipodi:role="line" id="tspan8666" x="-326.82172" y="-349.80621">Seamless pattern</tspan></text>
-<flowRoot xml:space="preserve" id="infoText" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.75px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" transform="translate(-709.3014,-231.7039)"><flowRegion id="flowRegion11597"><rect ry="0.9706131" id="rect11599" width="491.7114" height="324.9937" x="383.7567" y="-110.4523" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.75px;font-family:sans-serif;-inkscape-font-specification:sans-serif" /></flowRegion><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara6756">Use the layers &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7476">Pattern Foreground</flowSpan>&quot; and &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7478">Pattern Background</flowSpan>&quot; on the pattern page to create your design. The separation into two layers will make it easier for you to create and edit overlapping content like a foreground drawing with a background fill.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7456"></flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7458">The layer named &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7480">Pattern</flowSpan>&quot; is for using the seamless pattern, copying it to other documents, adding opacity etc. </flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7460">Select the group on the page, and use <flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7484">Object-&gt;Pattern-&gt;Objects to Pattern</flowSpan> to convert your creation into a fill pattern.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7462"></flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7464">The layer &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7482">Preview Background</flowSpan>&quot; provides an easy way to preview your creation if it contains transparency.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7466">Changing this layer's visibility will not alter the pattern.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7468"></flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7470">If an object is moved outside the pattern/page limits, it will be difficult to select it. </flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7472">To move it back onto the page, select the object using the rubberband selection (click and drag a selection box) with the selection tool.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7474">Then move it back onto the page, using the arrow keys or the &quot;Align and Distribute&quot; dialog (Shift+Ctrl+A).</flowPara></flowRoot><path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path19539" d="m -334.4906,-359.49 -26.1704,0 0,411.00566 229.6052,0" style="color:#000000;text-decoration:none;text-decoration-line:none;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3.7795277;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-end:url(#Arrow2Mend);enable-background:accumulate" />
+<flowRoot xml:space="preserve" id="infoText" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.75px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" transform="translate(-709.3014,-231.7039)"><flowRegion id="flowRegion11597"><rect ry="0.9706131" id="rect11599" width="491.7114" height="324.9937" x="383.7567" y="-110.4523" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.75px;font-family:sans-serif;-inkscape-font-specification:sans-serif" /></flowRegion><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara6756">Use the layers &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7476">Pattern Foreground</flowSpan>&quot; and &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7478">Pattern Background</flowSpan>&quot; on the pattern page to create your design. The separation into two layers will make it easier for you to create and edit overlapping content like a foreground drawing with a background fill.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7456" /><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7458">The layer named &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7480">Pattern</flowSpan>&quot; is for using the seamless pattern, copying it to other documents, adding opacity etc. </flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7460">Select the group on the page, and use <flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7484">Object-&gt;Pattern-&gt;Objects to Pattern</flowSpan> to convert your creation into a fill pattern.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7462" /><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7464">The layer &quot;<flowSpan style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Cantarell;-inkscape-font-specification:'Cantarell Bold'" id="flowSpan7482">Preview Background</flowSpan>&quot; provides an easy way to preview your creation if it contains transparency.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7466">Changing this layer's visibility will not alter the pattern.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7468" /><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7470">If an object is moved outside the pattern/page limits, it will be difficult to select it. </flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7472">To move it back onto the page, select the object using the rubberband selection (click and drag a selection box) with the selection tool.</flowPara><flowPara style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.5px;font-family:Cantarell;-inkscape-font-specification:Cantarell" id="flowPara7474">Then move it back onto the page, using the arrow keys or the &quot;Align and Distribute&quot; dialog (Shift+Ctrl+A).</flowPara></flowRoot><path sodipodi:nodetypes="cccc" inkscape:connector-curvature="0" id="path19539" d="m -334.4906,-359.49 -26.1704,0 0,411.00566 229.6052,0" style="color:#000000;text-decoration:none;text-decoration-line:none;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3.7795277;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-end:url(#Arrow2Mend);enable-background:accumulate" />
</g>
<g id="textPreview" sodipodi:insensitive="true">
<path d="m -29.56541,100 0,-7.16704 2.00731,0 0,4.51126 1.91761,0 0,-4.24223 2.00731,0 0,4.24223 4.36647,0 0,2.65578 -10.2987,0 z" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:medium;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="path9845" inkscape:connector-curvature="0" />
diff --git a/src/Makefile.am b/src/Makefile.am
index 7a37f13e8..04e33c471 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,7 +46,6 @@ all_libs = \
$(FREETYPE_LIBS) \
$(kdeldadd) \
$(win32ldflags) \
- $(CARBON_LDFLAGS) \
$(LIBWPG_LIBS) \
$(LIBVISIO_LIBS) \
$(LIBCDR_LIBS) \
diff --git a/src/attributes.cpp b/src/attributes.cpp
index af19360c1..991834cb2 100644
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
@@ -125,6 +125,7 @@ static SPStyleProp const props[] = {
/* SPGuide */
{SP_ATTR_ORIENTATION, "orientation"},
{SP_ATTR_POSITION, "position"},
+ {SP_ATTR_INKSCAPE_COLOR, "inkscape:color"},
/* SPImage */
{SP_ATTR_X, "x"},
{SP_ATTR_Y, "y"},
diff --git a/src/attributes.h b/src/attributes.h
index 7d6ea70a0..47f1388b0 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -127,6 +127,7 @@ enum SPAttributeEnum {
/* SPGuide */
SP_ATTR_ORIENTATION,
SP_ATTR_POSITION,
+ SP_ATTR_INKSCAPE_COLOR,
/* SPImage */
SP_ATTR_X,
SP_ATTR_Y,
diff --git a/src/libgdl/gdl-dock-item-grip.c b/src/libgdl/gdl-dock-item-grip.c
index d23eb7f98..9b3810c20 100644
--- a/src/libgdl/gdl-dock-item-grip.c
+++ b/src/libgdl/gdl-dock-item-grip.c
@@ -149,6 +149,8 @@ gdl_dock_item_grip_expose (GtkWidget *widget,
}
+/* see bug #950556: may contribute to regression with GTK2/Quartz */
+#if !defined(GDK_WINDOWING_QUARTZ)
if (gdl_dock_item_or_child_has_focus(grip->item)) {
gtk_paint_focus (gtk_widget_get_style (widget),
@@ -157,6 +159,7 @@ gdl_dock_item_grip_expose (GtkWidget *widget,
&event->area, widget,
NULL, 0, 0, -1, -1);
}
+#endif //GDK_WINDOWING_QUARTZ
return GTK_WIDGET_CLASS (gdl_dock_item_grip_parent_class)->expose_event (widget, event);
}
diff --git a/src/libgdl/gdl-dock-item.c b/src/libgdl/gdl-dock-item.c
index afcd4dfcb..af630e681 100644
--- a/src/libgdl/gdl-dock-item.c
+++ b/src/libgdl/gdl-dock-item.c
@@ -1064,8 +1064,11 @@ gdl_dock_item_paint (GtkWidget *widget,
"dockitem",
0, 0, -1, -1);
+/* see bug #950556: avoid regression with GTK2/Quartz */
+#if !defined(GDK_WINDOWING_QUARTZ)
if (GTK_IS_WIDGET(item->_priv->grip))
gtk_widget_queue_draw (GTK_WIDGET(item->_priv->grip));
+#endif
}
static gint
diff --git a/src/live_effects/CMakeLists.txt b/src/live_effects/CMakeLists.txt
index ab7ba6b4e..a1aa811a9 100644
--- a/src/live_effects/CMakeLists.txt
+++ b/src/live_effects/CMakeLists.txt
@@ -6,6 +6,7 @@ set(live_effects_SRC
lpe-bounding-box.cpp
lpe-bspline.cpp
lpe-circle_3pts.cpp
+ lpe-transform_2pts.cpp
lpe-circle_with_radius.cpp
lpe-clone-original.cpp
lpe-constructgrid.cpp
@@ -83,6 +84,7 @@ set(live_effects_SRC
lpe-bounding-box.h
lpe-bspline.h
lpe-circle_3pts.h
+ lpe-transform_2pts.h
lpe-circle_with_radius.h
lpe-clone-original.h
lpe-constructgrid.h
diff --git a/src/live_effects/Makefile_insert b/src/live_effects/Makefile_insert
index c2c2ce93c..b5bee55c8 100644
--- a/src/live_effects/Makefile_insert
+++ b/src/live_effects/Makefile_insert
@@ -74,6 +74,8 @@ ink_common_sources += \
live_effects/lpe-mirror_symmetry.h \
live_effects/lpe-circle_3pts.cpp \
live_effects/lpe-circle_3pts.h \
+ live_effects/lpe-transform_2pts.cpp \
+ live_effects/lpe-transform_2pts.h \
live_effects/lpe-angle_bisector.cpp \
live_effects/lpe-angle_bisector.h \
live_effects/lpe-parallel.cpp \
diff --git a/src/live_effects/effect-enum.h b/src/live_effects/effect-enum.h
index 383eec19e..eea26184c 100644
--- a/src/live_effects/effect-enum.h
+++ b/src/live_effects/effect-enum.h
@@ -38,6 +38,7 @@ enum EffectType {
TANGENT_TO_CURVE,
MIRROR_SYMMETRY,
CIRCLE_3PTS,
+ TRANSFORM_2PTS,
ANGLE_BISECTOR,
PARALLEL,
COPY_ROTATE,
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 332d81777..fe7bf3a97 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -57,6 +57,7 @@
#include "live_effects/lpe-sketch.h"
#include "live_effects/lpe-spiro.h"
#include "live_effects/lpe-tangent_to_curve.h"
+#include "live_effects/lpe-transform_2pts.h"
#include "live_effects/lpe-taperstroke.h"
#include "live_effects/lpe-test-doEffect-stack.h"
#include "live_effects/lpe-text_label.h"
@@ -150,6 +151,7 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{PERSPECTIVE_ENVELOPE, N_("Perspective/Envelope"), "perspective-envelope"},
{FILLET_CHAMFER, N_("Fillet/Chamfer"), "fillet-chamfer"},
{INTERPOLATE_POINTS, N_("Interpolate points"), "interpolate_points"},
+ {TRANSFORM_2PTS, N_("Transform by 2 points"), "transform_2pts"},
};
const Util::EnumDataConverter<EffectType> LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData));
@@ -315,6 +317,9 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj)
case SHOW_HANDLES:
neweffect = static_cast<Effect*> ( new LPEShowHandles(lpeobj) );
break;
+ case TRANSFORM_2PTS:
+ neweffect = static_cast<Effect*> ( new LPETransform2Pts(lpeobj) );
+ break;
default:
g_warning("LivePathEffect::Effect::New called with invalid patheffect type (%d)", lpenr);
neweffect = NULL;
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 019584943..0cae1dcb6 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -365,91 +365,52 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weight_ammount)
point_at0 = in->first_segment()->initialPoint();
point_at3 = in->first_segment()->finalPoint();
sbasis_in = in->first_segment()->toSBasis();
- if (!only_selected) {
- if (cubic) {
- if (!ignore_cusp || !Geom::are_near((*cubic)[1], point_at0)) {
+ if (cubic) {
+ if (!ignore_cusp || !Geom::are_near((*cubic)[1], point_at0)) {
+ if (isNodePointSelected(point_at0) || !only_selected) {
point_at1 = sbasis_in.valueAt(weight_ammount);
if (weight_ammount != NO_POWER) {
point_at1 =
Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
}
} else {
- point_at1 = in->first_segment()->initialPoint();
- }
- if (!ignore_cusp || !Geom::are_near((*cubic)[2], point_at3)) {
- point_at2 = sbasis_in.valueAt(1 - weight_ammount);
- if (weight_ammount != NO_POWER) {
- point_at2 =
- Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
- }
- } else {
- point_at2 = in->first_segment()->finalPoint();
+ point_at1 = (*cubic)[1];
}
} else {
- if (!ignore_cusp && weight_ammount != NO_POWER) {
- point_at1 = sbasis_in.valueAt(weight_ammount);
- if (weight_ammount != NO_POWER) {
- point_at1 =
- Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
- }
+ point_at1 = in->first_segment()->initialPoint();
+ }
+ if (!ignore_cusp || !Geom::are_near((*cubic)[2], point_at3)) {
+ if (isNodePointSelected(point_at3) || !only_selected) {
point_at2 = sbasis_in.valueAt(1 - weight_ammount);
if (weight_ammount != NO_POWER) {
point_at2 =
Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
}
} else {
- point_at1 = in->first_segment()->initialPoint();
- point_at2 = in->first_segment()->finalPoint();
+ point_at2 = (*cubic)[2];
}
+ } else {
+ point_at2 = in->first_segment()->finalPoint();
}
} else {
- if (cubic) {
- if (!ignore_cusp || !Geom::are_near((*cubic)[1], point_at0)) {
- if (isNodePointSelected(point_at0)) {
- point_at1 = sbasis_in.valueAt(weight_ammount);
- if (weight_ammount != NO_POWER) {
- point_at1 =
- Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
- }
- } else {
- point_at1 = (*cubic)[1];
- }
+ if (!ignore_cusp && weight_ammount != NO_POWER) {
+ if (isNodePointSelected(point_at0) || !only_selected) {
+ point_at1 = sbasis_in.valueAt(weight_ammount);
+ point_at1 =
+ Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
} else {
point_at1 = in->first_segment()->initialPoint();
}
- if (!ignore_cusp || !Geom::are_near((*cubic)[2], point_at3)) {
- if (isNodePointSelected(point_at3)) {
- point_at2 = sbasis_in.valueAt(1 - weight_ammount);
- if (weight_ammount != NO_POWER) {
- point_at2 =
- Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
- }
- } else {
- point_at2 = (*cubic)[2];
- }
+ if (isNodePointSelected(point_at3) || !only_selected) {
+ point_at2 = sbasis_in.valueAt(weight_ammount);
+ point_at2 =
+ Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
} else {
point_at2 = in->first_segment()->finalPoint();
}
} else {
- if (!ignore_cusp && weight_ammount != NO_POWER) {
- if (isNodePointSelected(point_at0)) {
- point_at1 = sbasis_in.valueAt(weight_ammount);
- point_at1 =
- Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
- } else {
- point_at1 = in->first_segment()->initialPoint();
- }
- if (isNodePointSelected(point_at3)) {
- point_at2 = sbasis_in.valueAt(weight_ammount);
- point_at2 =
- Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
- } else {
- point_at2 = in->first_segment()->finalPoint();
- }
- } else {
- point_at1 = in->first_segment()->initialPoint();
- point_at2 = in->first_segment()->finalPoint();
- }
+ point_at1 = in->first_segment()->initialPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
}
in->reset();
diff --git a/src/live_effects/lpe-transform_2pts.cpp b/src/live_effects/lpe-transform_2pts.cpp
new file mode 100644
index 000000000..b70b68968
--- /dev/null
+++ b/src/live_effects/lpe-transform_2pts.cpp
@@ -0,0 +1,320 @@
+/** \file
+ * LPE "Transform through 2 points" implementation
+ */
+
+/*
+ * Authors:
+ * Jabier Arraiza Cenoz<jabier.arraiza@marker.es>
+ *
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include <gtkmm.h>
+
+#include "live_effects/lpe-transform_2pts.h"
+#include "display/curve.h"
+#include <2geom/transforms.h>
+#include <2geom/pathvector.h>
+#include "sp-path.h"
+#include "ui/icon-names.h"
+
+#include <glibmm/i18n.h>
+
+namespace Inkscape {
+namespace LivePathEffect {
+
+LPETransform2Pts::LPETransform2Pts(LivePathEffectObject *lpeobject) :
+ Effect(lpeobject),
+ from_original_width(_("From original width"), _("From original width"), "from_original_width", &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"),
+ first_knot(_("First Knot"), _("First Knot"), "first_knot", &wr, this, 1),
+ last_knot(_("Last Knot"), _("Last Knot"), "last_knot", &wr, this, 1),
+ from_original_width_toggler(false),
+ point_a(Geom::Point()),
+ point_b(Geom::Point()),
+ pathvector(),
+ append_path(false)
+{
+ registerParameter(&start);
+ registerParameter(&end);
+ registerParameter(&first_knot);
+ registerParameter(&last_knot);
+ registerParameter(&from_original_width);
+
+ first_knot.param_make_integer(true);
+ last_knot.param_make_integer(true);
+}
+
+LPETransform2Pts::~LPETransform2Pts()
+{
+}
+
+void
+LPETransform2Pts::doOnApply(SPLPEItem const* lpeitem)
+{
+ using namespace Geom;
+ original_bbox(lpeitem);
+
+ point_a = Point(boundingbox_X.min(), boundingbox_Y.middle());
+ point_b = Point(boundingbox_X.max(), boundingbox_Y.middle());
+ SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeitem);
+ SPPath *sp_path = dynamic_cast<SPPath *>(splpeitem);
+ if (sp_path) {
+ pathvector = sp_path->get_original_curve()->get_pathvector();
+ }
+ if(!pathvector.empty()) {
+ point_a = pathvector.initialPoint();
+ point_b = pathvector.finalPoint();
+ if(are_near(point_a,point_b)){
+ point_b = pathvector.back().finalCurve().initialPoint();
+ }
+ size_t nnodes = nodeCount(pathvector);
+ last_knot.param_set_value(nnodes);
+ }
+ start.param_update_default(point_a);
+ start.param_set_default();
+ end.param_update_default(point_b);
+ end.param_set_default();
+}
+
+void
+LPETransform2Pts::doBeforeEffect (SPLPEItem const* lpeitem)
+{
+ using namespace Geom;
+ original_bbox(lpeitem);
+ point_a = Point(boundingbox_X.min(), boundingbox_Y.middle());
+ point_b = Point(boundingbox_X.max(), boundingbox_Y.middle());
+
+ SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeitem);
+ SPPath *sp_path = dynamic_cast<SPPath *>(splpeitem);
+ if (sp_path) {
+ pathvector = sp_path->get_original_curve()->get_pathvector();
+ }
+ if(from_original_width_toggler != from_original_width) {
+ from_original_width_toggler = from_original_width;
+ reset();
+ }
+ if(!pathvector.empty() && !from_original_width) {
+ append_path = false;
+ point_a = pointAtNodeIndex(pathvector,(size_t)first_knot-1);
+ point_b = pointAtNodeIndex(pathvector,(size_t)last_knot-1);
+ size_t nnodes = nodeCount(pathvector);
+ std::cout << nnodes << "nnodes\n";
+ first_knot.param_set_range(1, last_knot-1);
+ last_knot.param_set_range(first_knot+1, nnodes);
+ from_original_width.param_setValue(false);
+ } else {
+ first_knot.param_set_value(1);
+ last_knot.param_set_value(2);
+ first_knot.param_set_range(1,1);
+ last_knot.param_set_range(2,2);
+ from_original_width.param_setValue(true);
+ append_path = false;
+ }
+ splpeitem->apply_to_clippath(splpeitem);
+ splpeitem->apply_to_mask(splpeitem);
+}
+
+void
+LPETransform2Pts::updateIndex()
+{
+ SPLPEItem * splpeitem = const_cast<SPLPEItem *>(sp_lpe_item);
+ SPPath *sp_path = dynamic_cast<SPPath *>(splpeitem);
+ if (sp_path) {
+ pathvector = sp_path->get_original_curve()->get_pathvector();
+ }
+ if(!pathvector.empty() && !from_original_width) {
+ point_a = pointAtNodeIndex(pathvector,(size_t)first_knot-1);
+ point_b = pointAtNodeIndex(pathvector,(size_t)last_knot-1);
+ start.param_update_default(point_a);
+ start.param_set_default();
+ end.param_update_default(point_b);
+ end.param_set_default();
+ start.param_update_default(point_a);
+ end.param_update_default(point_b);
+ start.param_set_default();
+ end.param_set_default();
+ }
+}
+//todo migrate to PathVector class?
+size_t
+LPETransform2Pts::nodeCount(Geom::PathVector pathvector) const
+{
+ size_t n = 0;
+ for (Geom::PathVector::iterator it = pathvector.begin(); it != pathvector.end(); ++it) {
+ n += it->size_closed();
+ }
+ return n;
+}
+//todo migrate to PathVector class?
+Geom::Point
+LPETransform2Pts::pointAtNodeIndex(Geom::PathVector pathvector, size_t index) const
+{
+ size_t n = 0;
+ for (Geom::PathVector::iterator pv_it = pathvector.begin(); pv_it != pathvector.end(); ++pv_it) {
+ for (Geom::Path::iterator curve_it = pv_it->begin(); curve_it != pv_it->end_closed(); ++curve_it) {
+ if(index == n){
+ return curve_it->initialPoint();
+ }
+ n++;
+ }
+ }
+ return Geom::Point();
+}
+//todo migrate to PathVector class? Not used
+Geom::Path
+LPETransform2Pts::pathAtNodeIndex(Geom::PathVector pathvector, size_t index) const
+{
+ size_t n = 0;
+ for (Geom::PathVector::iterator pv_it = pathvector.begin(); pv_it != pathvector.end(); ++pv_it) {
+ for (Geom::Path::iterator curve_it = pv_it->begin(); curve_it != pv_it->end_closed(); ++curve_it) {
+ if(index == n){
+ return *pv_it;
+ }
+ n++;
+ }
+ }
+ return Geom::Path();
+}
+
+
+void
+LPETransform2Pts::reset()
+{
+ point_a = Geom::Point(boundingbox_X.min(), boundingbox_Y.middle());
+ point_b = Geom::Point(boundingbox_X.max(), boundingbox_Y.middle());
+ if(!pathvector.empty() && !from_original_width) {
+ size_t nnodes = nodeCount(pathvector);
+ first_knot.param_set_range(1, last_knot-1);
+ last_knot.param_set_range(first_knot+1, nnodes);
+ first_knot.param_set_value(1);
+ last_knot.param_set_value(nnodes);
+ point_a = pathvector.initialPoint();
+ point_b = pathvector.finalPoint();
+ } else {
+ first_knot.param_set_value(1);
+ last_knot.param_set_value(2);
+ }
+ start.param_update_default(point_a);
+ end.param_update_default(point_b);
+ start.param_set_default();
+ end.param_set_default();
+}
+
+Gtk::Widget *LPETransform2Pts::newWidget()
+{
+ // use manage here, because after deletion of Effect object, others might
+ // still be pointing to this widget.
+ Gtk::VBox *vbox = Gtk::manage(new Gtk::VBox(Effect::newWidget()));
+
+ vbox->set_border_width(5);
+ vbox->set_homogeneous(false);
+ vbox->set_spacing(6);
+
+ std::vector<Parameter *>::iterator it = param_vector.begin();
+ Gtk::HBox * button = Gtk::manage(new Gtk::HBox(true,0));
+ while (it != param_vector.end()) {
+ if ((*it)->widget_is_visible) {
+ Parameter *param = *it;
+ Gtk::Widget *widg = dynamic_cast<Gtk::Widget *>(param->param_newWidget());
+ Glib::ustring *tip = param->param_getTooltip();
+ if (param->param_key == "first_knot" || param->param_key == "last_knot") {
+ Inkscape::UI::Widget::Scalar *registered_widget = Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg));
+ registered_widget->signal_value_changed().connect(sigc::mem_fun(*this, &LPETransform2Pts::updateIndex));
+ widg = registered_widget;
+ if (widg) {
+ Gtk::HBox *hbox_scalar = dynamic_cast<Gtk::HBox *>(widg);
+ std::vector<Gtk::Widget *> child_list = hbox_scalar->get_children();
+ Gtk::Entry *entry_widget = dynamic_cast<Gtk::Entry *>(child_list[1]);
+ entry_widget->set_width_chars(3);
+ vbox->pack_start(*widg, true, true, 2);
+ if (tip) {
+ widg->set_tooltip_text(*tip);
+ } else {
+ widg->set_tooltip_text("");
+ widg->set_has_tooltip(false);
+ }
+ }
+ } else if (param->param_key == "from_original_width") {
+ Glib::ustring * tip = param->param_getTooltip();
+ if (widg) {
+ button->pack_start(*widg, true, true, 2);
+ if (tip) {
+ widg->set_tooltip_text(*tip);
+ } else {
+ widg->set_tooltip_text("");
+ widg->set_has_tooltip(false);
+ }
+ }
+ } else if (widg) {
+ vbox->pack_start(*widg, true, true, 2);
+ if (tip) {
+ widg->set_tooltip_text(*tip);
+ } else {
+ widg->set_tooltip_text("");
+ widg->set_has_tooltip(false);
+ }
+ }
+ }
+
+ ++it;
+ }
+ Gtk::Button *reset = Gtk::manage(new Gtk::Button(Glib::ustring(_("Reset"))));
+ reset->signal_clicked().connect(sigc::mem_fun(*this, &LPETransform2Pts::reset));
+ button->pack_start(*reset, true, true, 2);
+ vbox->pack_start(*button, true, true, 2);
+ return dynamic_cast<Gtk::Widget *>(vbox);
+}
+
+Geom::Piecewise<Geom::D2<Geom::SBasis> >
+LPETransform2Pts::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
+{
+ Geom::Piecewise<Geom::D2<Geom::SBasis> > output;
+ double sca = Geom::distance((Geom::Point)start,(Geom::Point)end)/Geom::distance(point_a,point_b);
+ Geom::Ray original(point_a,point_b);
+ Geom::Ray transformed((Geom::Point)start,(Geom::Point)end);
+ double rot = transformed.angle() - original.angle();
+ Geom::Path helper;
+ helper.start(point_a);
+ helper.appendNew<Geom::LineSegment>(point_b);
+ Geom::Affine m;
+ m *= Geom::Scale(sca);
+ m *= Geom::Rotate(rot);
+ helper *= m;
+ m *= Geom::Translate((Geom::Point)start - helper.initialPoint());
+ output.concat(pwd2_in * m);
+
+ return output;
+}
+
+void
+LPETransform2Pts::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
+{
+ using namespace Geom;
+ hp_vec.clear();
+ Geom::Path hp;
+ hp.start((Geom::Point)start);
+ hp.appendNew<Geom::LineSegment>((Geom::Point)end);
+ Geom::PathVector pathv;
+ pathv.push_back(hp);
+ hp_vec.push_back(pathv);
+}
+
+
+/* ######################## */
+
+} //namespace LivePathEffect
+} /* namespace Inkscape */
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
diff --git a/src/live_effects/lpe-transform_2pts.h b/src/live_effects/lpe-transform_2pts.h
new file mode 100644
index 000000000..855780a7a
--- /dev/null
+++ b/src/live_effects/lpe-transform_2pts.h
@@ -0,0 +1,80 @@
+#ifndef INKSCAPE_LPE_TRANSFORM_2PTS_H
+#define INKSCAPE_LPE_TRANSFORM_2PTS_H
+
+/** \file
+ * LPE "Transform through 2 points" implementation
+ */
+
+/*
+ * Authors:
+ *
+ *
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "live_effects/effect.h"
+#include "live_effects/lpegroupbbox.h"
+#include "live_effects/parameter/parameter.h"
+#include "live_effects/parameter/togglebutton.h"
+#include "live_effects/parameter/point.h"
+
+namespace Inkscape {
+namespace LivePathEffect {
+
+class LPETransform2Pts : public Effect, GroupBBoxEffect {
+public:
+ LPETransform2Pts(LivePathEffectObject *lpeobject);
+ virtual ~LPETransform2Pts();
+
+ virtual void doOnApply (SPLPEItem const* lpeitem);
+
+ virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
+
+ virtual void doBeforeEffect (SPLPEItem const* lpeitem);
+
+ virtual Gtk::Widget *newWidget();
+
+ void updateIndex();
+
+ size_t nodeCount(Geom::PathVector pathvector) const;
+
+ Geom::Point pointAtNodeIndex(Geom::PathVector pathvector, size_t index) const;
+
+ Geom::Path pathAtNodeIndex(Geom::PathVector pathvector, size_t index) const;
+
+ void reset();
+
+protected:
+ virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec);
+
+private:
+ ToggleButtonParam from_original_width;
+ PointParam start;
+ PointParam end;
+ ScalarParam first_knot;
+ ScalarParam last_knot;
+ bool from_original_width_toggler;
+ Geom::Point point_a;
+ Geom::Point point_b;
+ Geom::PathVector pathvector;
+ bool append_path;
+ LPETransform2Pts(const LPETransform2Pts&);
+ LPETransform2Pts& operator=(const LPETransform2Pts&);
+};
+
+} //namespace LivePathEffect
+} //namespace Inkscape
+
+#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
diff --git a/src/sp-factory.cpp b/src/sp-factory.cpp
index 84329eaaf..20472d425 100644
--- a/src/sp-factory.cpp
+++ b/src/sp-factory.cpp
@@ -294,6 +294,8 @@ SPObject *SPFactory::createObject(std::string const& id)
{}
else if (id == "inkscape:clipboard") // SP node not necessary
{}
+ else if (id == "inkscape:_templateinfo") // ?
+ {}
else if (id.empty()) // comments
{}
else {
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 4e1c5913d..b9c124138 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -26,6 +26,7 @@
#include "display/sp-canvas.h"
#include "display/guideline.h"
#include "svg/svg.h"
+#include "svg/svg-color.h"
#include "svg/stringstream.h"
#include "attributes.h"
#include "sp-guide.h"
@@ -70,6 +71,7 @@ void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr)
{
SPObject::build(document, repr);
+ this->readAttr( "inkscape:color" );
this->readAttr( "inkscape:label" );
this->readAttr( "orientation" );
this->readAttr( "position" );
@@ -95,6 +97,11 @@ void SPGuide::release()
void SPGuide::set(unsigned int key, const gchar *value) {
switch (key) {
+ case SP_ATTR_INKSCAPE_COLOR:
+ if (value) {
+ this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f);
+ }
+ break;
case SP_ATTR_INKSCAPE_LABEL:
if (this->label) g_free(this->label);
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 12c2cdf8e..b8554f352 100644
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -249,6 +249,7 @@ void SPNamedView::build(SPDocument *document, Inkscape::XML::Node *repr) {
//g_object_set(G_OBJECT(g), "color", nv->guidecolor, "hicolor", nv->guidehicolor, NULL);
g->setColor(this->guidecolor);
g->setHiColor(this->guidehicolor);
+ g->readAttr( "inkscape:color" );
}
}
@@ -325,8 +326,9 @@ void SPNamedView::set(unsigned int key, const gchar* value) {
}
for (GSList *l = this->guides; l != NULL; l = l->next) {
- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
- SP_GUIDE(l->data)->setColor(this->guidecolor);
+ SPGuide * g = SP_GUIDE(l->data);
+ g->setColor(this->guidecolor);
+ g->readAttr("inkscape:color");
}
this->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -336,8 +338,9 @@ void SPNamedView::set(unsigned int key, const gchar* value) {
sp_nv_read_opacity(value, &this->guidecolor);
for (GSList *l = this->guides; l != NULL; l = l->next) {
- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
- SP_GUIDE(l->data)->setColor(this->guidecolor);
+ SPGuide * g = SP_GUIDE(l->data);
+ g->setColor(this->guidecolor);
+ g->readAttr("inkscape:color");
}
this->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -662,6 +665,7 @@ void SPNamedView::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *r
//g_object_set(G_OBJECT(g), "color", this->guidecolor, "hicolor", this->guidehicolor, NULL);
g->setColor(this->guidecolor);
g->setHiColor(this->guidehicolor);
+ g->readAttr("inkscape:color");
if (this->editable) {
for (GSList *l = this->views; l != NULL; l = l->next) {
diff --git a/src/sp-paint-server.cpp b/src/sp-paint-server.cpp
index c3416c6c8..d445ca0a7 100644
--- a/src/sp-paint-server.cpp
+++ b/src/sp-paint-server.cpp
@@ -39,7 +39,9 @@ SPPaintServer::~SPPaintServer() {
bool SPPaintServer::isSwatch() const
{
- return swatch;
+ if( this ) // Protect against assumption that "vector" always exists.
+ return swatch;
+ return( false );
}