summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-21 14:29:02 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-21 14:29:02 +0000
commitb6d303d11e572d8888d29c44e11d06d256821a03 (patch)
tree715b43f92a002f4c2a3bdadc7fb10675b60d85eb /src
parentdisable rev 13709, following Bug 1365451, comments 13-16 (diff)
downloadinkscape-b6d303d11e572d8888d29c44e11d06d256821a03.tar.gz
inkscape-b6d303d11e572d8888d29c44e11d06d256821a03.zip
Implement rendering for 'context-fill' and 'context-stroke' (text not handled yet).
(bzr r13807)
Diffstat (limited to 'src')
-rw-r--r--src/display/drawing-item.cpp56
-rw-r--r--src/display/drawing-item.h10
-rw-r--r--src/display/drawing-pattern.h1
-rw-r--r--src/display/drawing-shape.cpp14
-rw-r--r--src/display/drawing-shape.h3
-rw-r--r--src/display/drawing-text.cpp15
-rw-r--r--src/display/drawing-text.h6
-rw-r--r--src/display/nr-style.cpp89
-rw-r--r--src/display/nr-style.h3
-rw-r--r--src/sp-item-group.cpp13
-rw-r--r--src/sp-marker.h7
-rw-r--r--src/sp-shape.cpp27
-rw-r--r--src/sp-text.cpp6
-rw-r--r--src/sp-use.cpp11
14 files changed, 183 insertions, 78 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index 407adc255..83d4744c9 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -110,6 +110,7 @@ DrawingItem::DrawingItem(Drawing &drawing)
, _parent(NULL)
, _key(0)
, _style(NULL)
+ , _context_style(NULL)
, _opacity(1.0)
, _transform(NULL)
, _clip(NULL)
@@ -360,15 +361,10 @@ DrawingItem::setCached(bool cached, bool persistent)
* Note: _style is not used by DrawingGlyphs which uses its parent style.
*/
void
-DrawingItem::setStyle(SPStyle *style)
+DrawingItem::setStyle(SPStyle *style, SPStyle *context_style)
{
- // std::cout << "DrawingItem::setStyle: ";
- // SPObject *item = static_cast<SPObject *>(_user_data);
- // if( item ) {
- // std::cout << (item->getId()?item->getId():"null") << std::endl;
- // } else {
- // std::cout << "No item" << std::endl;
- // }
+ // std::cout << "DrawingItem::setStyle: " << name() << " " << style
+ // << " " << context_style << std::endl;
if (style) sp_style_ref(style);
if (_style) sp_style_unref(_style);
@@ -396,10 +392,33 @@ DrawingItem::setStyle(SPStyle *style)
}
}
+ if (context_style != NULL) {
+ _context_style = context_style;
+ } else if (_parent != NULL) {
+ _context_style = _parent->_context_style;
+ }
+
_markForUpdate(STATE_ALL, false);
}
+/**
+ * Recursively update children style.
+ * The purpose of this call is to update fill and stroke for markers that have elements with
+ * fill/stroke property values of 'context-fill' or 'context-stroke'. Marker styling is not
+ * updated like other 'clones' as marker instances are not included the SP object tree.
+ * Note: this is a virtual function.
+ */
+void
+DrawingItem::setChildrenStyle(SPStyle* context_style)
+{
+ _context_style = context_style;
+ for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) {
+ i->setChildrenStyle( context_style );
+ }
+}
+
+
void
DrawingItem::setClip(DrawingItem *item)
{
@@ -957,6 +976,20 @@ DrawingItem::pick(Geom::Point const &p, double delta, unsigned flags)
return NULL;
}
+// For debugging
+Glib::ustring
+DrawingItem::name()
+{
+ SPObject *object = static_cast<SPObject *>(_user_data);
+ if (object) {
+ if(object->getId())
+ return object->getId();
+ else
+ return "No object id";
+ } else {
+ return "No associated object";
+ }
+}
// For debugging: Print drawing tree structure.
void
@@ -969,12 +1002,7 @@ DrawingItem::recursivePrintTree( unsigned level )
for (unsigned i = 0; i < level; ++i) {
std::cout << " ";
}
- SPObject *object = static_cast<SPObject *>(_user_data);
- if (object) {
- std::cout << (object->getId()?object->getId():"No object id") << std::endl;
- } else {
- std::cout << "No associated object" << std::endl;
- }
+ std::cout << name() << std::endl;
for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) {
i->recursivePrintTree( level+1 );
}
diff --git a/src/display/drawing-item.h b/src/display/drawing-item.h
index 89331c13d..3c593ceaa 100644
--- a/src/display/drawing-item.h
+++ b/src/display/drawing-item.h
@@ -20,6 +20,10 @@
#include <exception>
#include <list>
+namespace Glib {
+class ustring;
+}
+
class SPStyle;
namespace Inkscape {
@@ -108,7 +112,8 @@ public:
bool cached() const { return _cached; }
void setCached(bool c, bool persistent = false);
- virtual void setStyle(SPStyle *style);
+ virtual void setStyle(SPStyle *style, SPStyle *context_style = NULL);
+ virtual void setChildrenStyle(SPStyle *context_style);
void setOpacity(float opacity);
void setAntialiasing(bool a);
void setIsolation(unsigned isolation); // CSS Compositing and Blending
@@ -132,6 +137,7 @@ public:
void clip(DrawingContext &dc, Geom::IntRect const &area);
DrawingItem *pick(Geom::Point const &p, double delta, unsigned flags = 0);
+ virtual Glib::ustring name(); // For debugging
void recursivePrintTree(unsigned level = 0); // For debugging
protected:
@@ -179,6 +185,8 @@ protected:
unsigned _key; ///< Some SPItems can have more than one DrawingItem;
/// this value is a hack used to distinguish between them
SPStyle *_style; // Not used by DrawingGlyphs
+ SPStyle *_context_style; // Used for 'context-fill', 'context-stroke'
+
float _opacity;
Geom::Affine *_transform; ///< Incremental transform from parent to this item's coords
diff --git a/src/display/drawing-pattern.h b/src/display/drawing-pattern.h
index 7483ba067..dc1f93ed1 100644
--- a/src/display/drawing-pattern.h
+++ b/src/display/drawing-pattern.h
@@ -15,7 +15,6 @@
#include "display/drawing-group.h"
typedef struct _cairo_pattern cairo_pattern_t;
-class SPStyle;
namespace Inkscape {
diff --git a/src/display/drawing-shape.cpp b/src/display/drawing-shape.cpp
index 5bdc7a323..63efb3c0d 100644
--- a/src/display/drawing-shape.cpp
+++ b/src/display/drawing-shape.cpp
@@ -62,10 +62,17 @@ DrawingShape::setPath(SPCurve *curve)
}
void
-DrawingShape::setStyle(SPStyle *style)
+DrawingShape::setStyle(SPStyle *style, SPStyle *context_style)
{
- _nrstyle.set(style);
- DrawingItem::setStyle(style);
+ DrawingItem::setStyle(style, context_style); // Must be first
+ _nrstyle.set(_style, _context_style);
+}
+
+void
+DrawingShape::setChildrenStyle(SPStyle* context_style)
+{
+ DrawingItem::setChildrenStyle( context_style );
+ _nrstyle.set(_style, _context_style);
}
unsigned
@@ -142,7 +149,6 @@ DrawingShape::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u
_bbox.unionWith(i->geometricBounds());
}
}
-
return STATE_ALL;
}
diff --git a/src/display/drawing-shape.h b/src/display/drawing-shape.h
index 1c921b21f..1cdbc636e 100644
--- a/src/display/drawing-shape.h
+++ b/src/display/drawing-shape.h
@@ -28,7 +28,8 @@ public:
~DrawingShape();
void setPath(SPCurve *curve);
- virtual void setStyle(SPStyle *style);
+ virtual void setStyle(SPStyle *style, SPStyle *context_style = NULL);
+ virtual void setChildrenStyle(SPStyle *context_style);
protected:
virtual unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx,
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp
index 58305477b..e20a7ff2a 100644
--- a/src/display/drawing-text.cpp
+++ b/src/display/drawing-text.cpp
@@ -56,7 +56,7 @@ DrawingGlyphs::setGlyph(font_instance *font, int glyph, Geom::Affine const &tran
}
void
-DrawingGlyphs::setStyle(SPStyle *style)
+DrawingGlyphs::setStyle(SPStyle * /*style*/, SPStyle * /*context_style*/)
{
std::cerr << "DrawingGlyphs: Use parent style" << std::endl;
}
@@ -223,10 +223,17 @@ DrawingText::addComponent(font_instance *font, int glyph, Geom::Affine const &tr
}
void
-DrawingText::setStyle(SPStyle *style)
+DrawingText::setStyle(SPStyle *style, SPStyle *context_style)
{
- _nrstyle.set(style);
- DrawingGroup::setStyle(style);
+ DrawingGroup::setStyle(style, context_style); // Must be first
+ _nrstyle.set(_style, _context_style);
+}
+
+void
+DrawingText::setChildrenStyle(SPStyle* context_style)
+{
+ DrawingGroup::setChildrenStyle( context_style );
+ _nrstyle.set(_style, _context_style);
}
unsigned
diff --git a/src/display/drawing-text.h b/src/display/drawing-text.h
index 37c1e81c7..3d248df9b 100644
--- a/src/display/drawing-text.h
+++ b/src/display/drawing-text.h
@@ -28,7 +28,7 @@ public:
~DrawingGlyphs();
void setGlyph(font_instance *font, int glyph, Geom::Affine const &trans);
- void setStyle(SPStyle *style); // Not to be used, prints error message.
+ virtual void setStyle(SPStyle *style, SPStyle *context_style = NULL); // Not to be used
protected:
unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx,
@@ -57,8 +57,8 @@ public:
void clear();
bool addComponent(font_instance *font, int glyph, Geom::Affine const &trans,
float width, float ascent, float descent, float phase_length);
- void setStyle(SPStyle *style);
-
+ virtual void setStyle(SPStyle *style, SPStyle *context_style = NULL);
+ virtual void setChildrenStyle(SPStyle *context_style);
protected:
virtual unsigned _updateItem(Geom::IntRect const &area, UpdateContext const &ctx,
diff --git a/src/display/nr-style.cpp b/src/display/nr-style.cpp
index 70382ef50..9dadaf3f1 100644
--- a/src/display/nr-style.cpp
+++ b/src/display/nr-style.cpp
@@ -93,35 +93,41 @@ NRStyle::~NRStyle()
text_decoration_stroke.clear();
}
-void NRStyle::set(SPStyle *style)
+void NRStyle::set(SPStyle *style, SPStyle *context_style)
{
// Handle 'context-fill' and 'context-stroke': Work in progress
- SPIPaint &style_fill = style->fill;
- if( style_fill.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
- // std::cout << "NRStyle::set: fill: context-fill" << std::endl;
- // style_fill = context_fill;
- } else if ( style_fill.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
- //std::cout << "NRStyle::set: fill: context-stroke" << std::endl;
- // style_fill = context_stroke;
+ const SPIPaint *style_fill = &(style->fill);
+ if( style_fill->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
+ if( context_style != NULL ) {
+ style_fill = &(context_style->fill);
+ } else {
+ std::cerr << "NRStyle::set: 'context-fill': 'context_style' is NULL" << std::endl;
+ }
+ } else if ( style_fill->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
+ if( context_style != NULL ) {
+ style_fill = &(context_style->stroke);
+ } else {
+ std::cerr << "NRStyle::set: 'context-stroke': 'context_style' is NULL" << std::endl;
+ }
}
-
- if ( style_fill.isPaintserver() ) {
+
+ if ( style_fill->isPaintserver() ) {
SPPaintServer* server = style->getFillPaintServer();
if ( server && server->isValid() ) {
fill.set(server);
- } else if ( style_fill.colorSet ) {
- fill.set(style_fill.value.color);
+ } else if ( style_fill->colorSet ) {
+ fill.set(style_fill->value.color);
} else {
fill.clear();
}
- } else if ( style_fill.isColor() ) {
- fill.set(style_fill.value.color);
- } else if ( style_fill.isNone() ) {
+ } else if ( style_fill->isColor() ) {
+ fill.set(style_fill->value.color);
+ } else if ( style_fill->isNone() ) {
fill.clear();
- } else if ( style_fill.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
- // std::cout << "NRStyle::set: fill: context-fill DOUBLE" << std::endl;
- } else if ( style_fill.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
- // std::cout << "NRStyle::set: fill: context-stroke DOUBLE" << std::endl;
+ } else if ( style_fill->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
+ std::cerr << "NRStyle::set: fill: context-fill: Double" << std::endl;
+ } else if ( style_fill->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
+ std::cerr << "NRStyle::set: fill: context-stroke: Double" << std::endl;
} else {
g_assert_not_reached();
}
@@ -139,26 +145,42 @@ void NRStyle::set(SPStyle *style)
g_assert_not_reached();
}
- if ( style->stroke.isPaintserver() ) {
+ const SPIPaint *style_stroke = &(style->stroke);
+ if( style_stroke->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
+ if( context_style != NULL ) {
+ style_stroke = &(context_style->fill);
+ } else {
+ std::cerr << "NRStyle::set: 'context-fill': 'context_style' is NULL" << std::endl;
+ }
+ } else if ( style_stroke->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
+ if( context_style != NULL ) {
+ style_stroke = &(context_style->stroke);
+ } else {
+ std::cerr << "NRStyle::set: 'context-stroke': 'context_style' is NULL" << std::endl;
+ }
+ }
+
+ if ( style_stroke->isPaintserver() ) {
SPPaintServer* server = style->getStrokePaintServer();
if ( server && server->isValid() ) {
stroke.set(server);
- } else if ( style->stroke.isColor() ) {
- stroke.set(style->stroke.colorSet);
+ } else if ( style_stroke->isColor() ) {
+ stroke.set(style_stroke->colorSet);
} else {
stroke.clear();
}
- } else if ( style->stroke.isColor() ) {
- stroke.set(style->stroke.value.color);
- } else if ( style->stroke.isNone() ) {
+ } else if ( style_stroke->isColor() ) {
+ stroke.set(style_stroke->value.color);
+ } else if ( style_stroke->isNone() ) {
stroke.clear();
- } else if ( style->stroke.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
- // std::cout << "NRStyle::set: stroke: context-fill" << std::endl;
- } else if ( style->stroke.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
- // std::cout << "NRStyle::set: stroke: context-stroke" << std::endl;
+ } else if ( style_stroke->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL ) {
+ std::cerr << "NRStyle::set: stroke: context-fill: Double" << std::endl;
+ } else if ( style_stroke->paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE ) {
+ std::cerr << "NRStyle::set: stroke: context-stroke: Double" << std::endl;
} else {
g_assert_not_reached();
}
+
stroke.opacity = SP_SCALE24_TO_FLOAT(style->stroke_opacity.value);
stroke_width = style->stroke_width.computed;
switch (style->stroke_linecap.computed) {
@@ -329,13 +351,16 @@ bool NRStyle::prepareFill(Inkscape::DrawingContext &dc, Geom::OptRect const &pai
fill_pattern = pattern->renderPattern(fill.opacity);
} else {
fill_pattern = fill.server->pattern_new(dc.raw(), paintbox, fill.opacity);
- } break;
+ }
+ break;
case PAINT_COLOR: {
SPColor const &c = fill.color;
fill_pattern = cairo_pattern_create_rgba(
c.v.c[0], c.v.c[1], c.v.c[2], fill.opacity);
- } break;
- default: break;
+ }
+ break;
+ default:
+ break;
}
}
if (!fill_pattern) return false;
diff --git a/src/display/nr-style.h b/src/display/nr-style.h
index f324fdb56..5f78795d3 100644
--- a/src/display/nr-style.h
+++ b/src/display/nr-style.h
@@ -1,6 +1,7 @@
/**
* @file
* Style information for rendering.
+ * Only used by classes DrawingShape and DrawingText
*//*
* Authors:
* Krzysztof KosiƄski <tweenk.pl@gmail.com>
@@ -28,7 +29,7 @@ struct NRStyle {
NRStyle();
~NRStyle();
- void set(SPStyle *);
+ void set(SPStyle *style, SPStyle *context_style = NULL);
bool prepareFill(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern);
bool prepareStroke(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern);
bool prepareTextDecorationFill(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern);
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 992bca631..796caa88b 100644
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -199,7 +199,11 @@ void SPGroup::update(SPCtx *ctx, unsigned int flags) {
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
for (SPItemView *v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingGroup *group = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
- group->setStyle(this->style);
+ if( this->parent ) {
+ group->setStyle(this->style, this->parent->style);
+ } else {
+ group->setStyle(this->style);
+ }
}
}
}
@@ -356,8 +360,11 @@ Inkscape::DrawingItem *SPGroup::show (Inkscape::Drawing &drawing, unsigned int k
ai = new Inkscape::DrawingGroup(drawing);
ai->setPickChildren(this->effectiveLayerMode(key) == SPGroup::LAYER);
- ai->setStyle(this->style);
-
+ if( this->parent ) {
+ ai->setStyle(this->style, this->parent->style);
+ } else {
+ ai->setStyle(this->style);
+ }
this->_showChildren(drawing, ai, key, flags);
return ai;
}
diff --git a/src/sp-marker.h b/src/sp-marker.h
index 54f37487a..e804fd7dc 100644
--- a/src/sp-marker.h
+++ b/src/sp-marker.h
@@ -63,7 +63,12 @@ public:
markerOrient orient_mode : 2;
SVGAngle orient;
- /* Private views indexed by key */
+ /* Private views indexed by key that corresponds to a
+ * particular marker type (start, mid, end) on a particular
+ * path. SPMarkerView is a wrapper for a vector of pointers to
+ * Inkscape::DrawingItem instances, one pointer for each
+ * rendered marker.
+ */
std::map<unsigned int, SPMarkerView> views_map;
virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 6d240fbf5..02b9969b3 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -145,7 +145,12 @@ void SPShape::update(SPCtx* ctx, guint flags) {
for (SPItemView *v = ((SPItem *) (this))->display; v != NULL; v = v->next) {
Inkscape::DrawingShape *sh = dynamic_cast<Inkscape::DrawingShape *>(v->arenaitem);
- sh->setStyle(this->style);
+ if (hasMarkers()) {
+ sh->setStyle(this->style, this->style);
+ sh->setChildrenStyle(style); // Resolve 'context-fill' and 'context-stroke' in children.
+ } else {
+ sh->setStyle(this->style, this->parent->style);
+ }
}
}
}
@@ -163,6 +168,7 @@ void SPShape::update(SPCtx* ctx, guint flags) {
}
if (this->hasMarkers ()) {
+
/* Dimension marker views */
for (SPItemView *v = this->display; v != NULL; v = v->next) {
if (!v->arenaitem->key()) {
@@ -387,7 +393,12 @@ void SPShape::modified(unsigned int flags) {
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
for (SPItemView *v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingShape *sh = dynamic_cast<Inkscape::DrawingShape *>(v->arenaitem);
- sh->setStyle(this->style);
+ if (hasMarkers()) {
+ sh->setStyle(this->style, this->style);
+ sh->setChildrenStyle(style); // Resolve 'context-fill' and 'context-stroke' in children.
+ } else {
+ sh->setStyle(this->style, this->parent->style);
+ }
}
}
}
@@ -719,7 +730,9 @@ void SPShape::print(SPPrintContext* ctx) {
Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int /*key*/, unsigned int /*flags*/) {
Inkscape::DrawingShape *s = new Inkscape::DrawingShape(drawing);
- s->setStyle(this->style);
+
+ bool has_markers = this->hasMarkers();
+
s->setPath(this->_curve);
/* This stanza checks that an object's marker style agrees with
@@ -731,7 +744,7 @@ Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int /*
sp_shape_set_marker (this, i, this->style->marker_ptrs[i]->value);
}
- if (this->hasMarkers ()) {
+ if (has_markers) {
/* provide key and dimension the marker views */
if (!s->key()) {
s->setKey(SPItem::display_key_new (SP_MARKER_LOC_QTY));
@@ -747,8 +760,12 @@ Inkscape::DrawingItem* SPShape::show(Inkscape::Drawing &drawing, unsigned int /*
/* Update marker views */
sp_shape_update_marker_view (this, s);
- }
+ s->setStyle(this->style,this->style);
+ s->setChildrenStyle(style); // Resolve 'context-fill' and 'context-stroke' in children.
+ } else {
+ s->setStyle(this->style, this->parent->style);
+ }
return s;
}
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 8922d3c73..a35a58bd9 100644
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
@@ -195,7 +195,7 @@ void SPText::update(SPCtx *ctx, guint flags) {
for (SPItemView* v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
this->_clearFlow(g);
- g->setStyle(this->style);
+ g->setStyle(this->style, this->parent->style);
// pass the bbox of the this this as paintbox (used for paintserver fills)
this->layout.show(g, paintbox);
}
@@ -221,7 +221,7 @@ void SPText::modified(guint flags) {
for (SPItemView* v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
this->_clearFlow(g);
- g->setStyle(this->style);
+ g->setStyle(this->style, this->parent->style);
this->layout.show(g, paintbox);
}
}
@@ -333,7 +333,7 @@ Geom::OptRect SPText::bbox(Geom::Affine const &transform, SPItem::BBoxType type)
Inkscape::DrawingItem* SPText::show(Inkscape::Drawing &drawing, unsigned /*key*/, unsigned /*flags*/) {
Inkscape::DrawingGroup *flowed = new Inkscape::DrawingGroup(drawing);
flowed->setPickChildren(false);
- flowed->setStyle(this->style);
+ flowed->setStyle(this->style, this->parent->style);
// pass the bbox of the text object as paintbox (used for paintserver fills)
this->layout.show(flowed, this->geometricBounds());
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index 2bd6757ff..cadd6a16c 100644
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
@@ -94,7 +94,7 @@ void SPUse::build(SPDocument *document, Inkscape::XML::Node *repr) {
// We don't need to create child here:
// reading xlink:href will attach ref, and that will cause the changed signal to be emitted,
- // which will call sp_use_href_changed, and that will take care of the child
+ // which will call SPUse::href_changed, and that will take care of the child
}
void SPUse::release() {
@@ -145,7 +145,7 @@ void SPUse::set(unsigned int key, const gchar* value) {
this->href = NULL;
if (value) {
- // First, set the href field, because sp_use_href_changed will need it.
+ // First, set the href field, because SPUse::href_changed will need it.
this->href = g_strdup(value);
// Now do the attaching, which emits the changed signal.
@@ -280,9 +280,10 @@ gchar* SPUse::description() const {
}
Inkscape::DrawingItem* SPUse::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) {
+
Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing);
ai->setPickChildren(false);
- ai->setStyle(this->style);
+ ai->setStyle(this->style, this->style);
if (this->child) {
Inkscape::DrawingItem *ac = this->child->invoke_show(drawing, key, flags);
@@ -579,7 +580,7 @@ void SPUse::update(SPCtx *ctx, unsigned flags) {
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
for (SPItemView *v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
- g->setStyle(this->style);
+ g->setStyle(this->style, this->style);
}
}
@@ -601,7 +602,7 @@ void SPUse::modified(unsigned int flags) {
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
for (SPItemView *v = this->display; v != NULL; v = v->next) {
Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
- g->setStyle(this->style);
+ g->setStyle(this->style, this->style);
}
}