Code

fix crash, allow combine to work transparently on groups
[inkscape.git] / src / sp-root.cpp
index 80c04c59f30461dec782391359e0b52b1f5d34c9..81d71044d9a8830afb05dbee053826e275069ace 100644 (file)
@@ -51,7 +51,6 @@ static void sp_root_modified(SPObject *object, guint flags);
 static Inkscape::XML::Node *sp_root_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
 
 static NRArenaItem *sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
-static void sp_root_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
 static void sp_root_print(SPItem *item, SPPrintContext *ctx);
 
 static SPGroupClass *parent_class;
@@ -106,7 +105,6 @@ sp_root_class_init(SPRootClass *klass)
     sp_object_class->write = sp_root_write;
 
     sp_item_class->show = sp_root_show;
-    sp_item_class->bbox = sp_root_bbox;
     sp_item_class->print = sp_root_print;
 }
 
@@ -176,7 +174,7 @@ sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
     }
 
     // clear transform, if any was read in - SVG does not allow transform= on <svg>
-    SP_ITEM(object)->transform = NR::identity();
+    SP_ITEM(object)->transform = Geom::identity();
 }
 
 /**
@@ -309,7 +307,7 @@ sp_root_set(SPObject *object, unsigned int key, gchar const *value)
                     align = SP_ASPECT_XMIN_YMID;
                 } else if (!strcmp(c, "xMidYMid")) {
                     align = SP_ASPECT_XMID_YMID;
-                } else if (!strcmp(c, "xMaxYMin")) {
+                } else if (!strcmp(c, "xMaxYMid")) {
                     align = SP_ASPECT_XMAX_YMID;
                 } else if (!strcmp(c, "xMinYMax")) {
                     align = SP_ASPECT_XMIN_YMAX;
@@ -322,7 +320,7 @@ sp_root_set(SPObject *object, unsigned int key, gchar const *value)
                 }
                 clip = SP_ASPECT_MEET;
                 while (*e && *e == 32) e += 1;
-                if (e) {
+                if (*e) {
                     if (!strcmp(e, "meet")) {
                         clip = SP_ASPECT_MEET;
                     } else if (!strcmp(e, "slice")) {
@@ -546,7 +544,7 @@ sp_root_update(SPObject *object, SPCtx *ctx, guint flags)
         rctx.vp.y1 = root->height.computed;
     }
 
-    rctx.i2vp = NR::identity();
+    rctx.i2vp = Geom::identity();
 
     /* And invoke parent method */
     if (((SPObjectClass *) (parent_class))->update)
@@ -640,22 +638,6 @@ sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags)
     return ai;
 }
 
-/**
- * Virtual bbox callback.
- */
-static void
-sp_root_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags)
-{
-    SPRoot const *root = SP_ROOT(item);
-
-    if (((SPItemClass *) (parent_class))->bbox) {
-        Geom::Matrix const product( to_2geom(root->c2p) * transform );
-        ((SPItemClass *) (parent_class))->bbox(item, bbox,
-                                               product,
-                                               flags);
-    }
-}
-
 /**
  * Virtual print callback.
  */