summaryrefslogtreecommitdiffstats
path: root/src/sp-clippath.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
commit945ce419c806c73d70203dec33ececafbe108a92 (patch)
treecfcdb59bf47e9db7f9e01f7eebb59924bdeaea94 /src/sp-clippath.cpp
parentMerge from trunk (again) (diff)
parentExtensions. SVG+media fix (see Bug #400356). (diff)
downloadinkscape-945ce419c806c73d70203dec33ececafbe108a92.tar.gz
inkscape-945ce419c806c73d70203dec33ececafbe108a92.zip
Merge from trunk
(bzr r9508.1.73)
Diffstat (limited to 'src/sp-clippath.cpp')
-rw-r--r--src/sp-clippath.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 310008713..4e9f37ee3 100644
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -97,9 +97,9 @@ void SPClipPath::build(SPObject *object, SPDocument *document, Inkscape::XML::No
void SPClipPath::release(SPObject * object)
{
- if (SP_OBJECT_DOCUMENT(object)) {
- /* Unregister ourselves */
- SP_OBJECT_DOCUMENT(object)->removeResource("clipPath", object);
+ if (object->document) {
+ // Unregister ourselves
+ object->document->removeResource("clipPath", object);
}
SPClipPath *cp = SP_CLIPPATH(object);
@@ -145,7 +145,7 @@ void SPClipPath::childAdded(SPObject *object, Inkscape::XML::Node *child, Inksca
((SPObjectClass *) (SPClipPathClass::static_parent_class))->child_added(object, child, ref);
/* Show new object */
- SPObject *ochild = SP_OBJECT_DOCUMENT(object)->getObjectByRepr(child);
+ SPObject *ochild = object->document->getObjectByRepr(child);
if (SP_IS_ITEM(ochild)) {
SPClipPath *cp = SP_CLIPPATH(object);
for (SPClipPathView *v = cp->display; v != NULL; v = v->next) {
@@ -186,7 +186,7 @@ void SPClipPath::update(SPObject *object, SPCtx *ctx, guint flags)
SPClipPath *cp = SP_CLIPPATH(object);
for (SPClipPathView *v = cp->display; v != NULL; v = v->next) {
if (cp->clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
- Geom::Matrix t(Geom::Scale(v->bbox.x1 - v->bbox.x0, v->bbox.y1 - v->bbox.y0));
+ Geom::Affine t(Geom::Scale(v->bbox.x1 - v->bbox.x0, v->bbox.y1 - v->bbox.y0));
t[4] = v->bbox.x0;
t[5] = v->bbox.y0;
nr_arena_group_set_child_transform(NR_ARENA_GROUP(v->arenaitem), &t);
@@ -253,7 +253,7 @@ NRArenaItem *SPClipPath::show(NRArena *arena, unsigned int key)
}
if (clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) {
- Geom::Matrix t(Geom::Scale(display->bbox.x1 - display->bbox.x0, display->bbox.y1 - display->bbox.y0));
+ Geom::Affine t(Geom::Scale(display->bbox.x1 - display->bbox.x0, display->bbox.y1 - display->bbox.y0));
t[4] = display->bbox.x0;
t[5] = display->bbox.y0;
nr_arena_group_set_child_transform(NR_ARENA_GROUP(ai), &t);
@@ -296,7 +296,7 @@ void SPClipPath::setBBox(unsigned int key, NRRect *bbox)
}
}
-void SPClipPath::getBBox(NRRect *bbox, Geom::Matrix const &transform, unsigned const /*flags*/)
+void SPClipPath::getBBox(NRRect *bbox, Geom::Affine const &transform, unsigned const /*flags*/)
{
SPObject *i = 0;
for (i = firstChild(); i && !SP_IS_ITEM(i); i = i->getNext()) {
@@ -305,13 +305,13 @@ void SPClipPath::getBBox(NRRect *bbox, Geom::Matrix const &transform, unsigned c
return;
}
- SP_ITEM(i)->invoke_bbox_full( bbox, Geom::Matrix(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE);
+ SP_ITEM(i)->invoke_bbox_full( bbox, Geom::Affine(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE);
SPObject *i_start = i;
while (i != NULL) {
if (i != i_start) {
NRRect i_box;
- SP_ITEM(i)->invoke_bbox_full( &i_box, Geom::Matrix(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE);
+ SP_ITEM(i)->invoke_bbox_full( &i_box, Geom::Affine(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE);
nr_rect_d_union (bbox, bbox, &i_box);
}
i = i->getNext();
@@ -354,9 +354,9 @@ sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view)
}
// Create a mask element (using passed elements), add it to <defs>
-const gchar *SPClipPath::create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform)
+const gchar *SPClipPath::create (GSList *reprs, SPDocument *document, Geom::Affine const* applyTransform)
{
- Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document));
+ Inkscape::XML::Node *defsrepr = SP_DOCUMENT_DEFS(document)->getRepr();
Inkscape::XML::Document *xml_doc = document->getReprDoc();
Inkscape::XML::Node *repr = xml_doc->createElement("svg:clipPath");
@@ -371,9 +371,9 @@ const gchar *SPClipPath::create (GSList *reprs, SPDocument *document, Geom::Matr
SPItem *item = SP_ITEM(clip_path_object->appendChildRepr(node));
if (NULL != applyTransform) {
- Geom::Matrix transform (item->transform);
+ Geom::Affine transform (item->transform);
transform *= (*applyTransform);
- item->doWriteTransform(SP_OBJECT_REPR(item), transform);
+ item->doWriteTransform(item->getRepr(), transform);
}
}