summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-11-01 03:43:30 +0000
committerTed Gould <ted@canonical.com>2008-11-01 03:43:30 +0000
commit0800a454f230fb7a029c88b0ab14bd9bb8a72bf1 (patch)
tree78f551f42f8331a8a4336bdc6a53fb88d6dfda92 /src
parentMaking it so that including simple-node.h will generate an error (diff)
downloadinkscape-0800a454f230fb7a029c88b0ab14bd9bb8a72bf1.tar.gz
inkscape-0800a454f230fb7a029c88b0ab14bd9bb8a72bf1.zip
Merge from trunk
(bzr r6890)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/cairo-renderer.cpp21
-rw-r--r--src/extension/internal/odf.cpp2
-rw-r--r--src/sp-shape.cpp10
3 files changed, 22 insertions, 11 deletions
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index af9c3cd6e..5d6315894 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -446,19 +446,23 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
TRACE(("sp_asbitmap_render: resolution: %f\n", res ));
// Get the bounding box of the selection in document coordinates.
- NRRect bbox(item->getBounds(sp_item_i2d_affine(item), SPItem::RENDERING_BBOX ));
+ boost::optional<Geom::Rect> bbox =
+ item->getBounds(sp_item_i2d_affine(item), SPItem::RENDERING_BBOX);
+
+ if (!bbox) // no bbox, e.g. empty group
+ return;
// The width and height of the bitmap in pixels
- unsigned width = (unsigned) floor ((bbox.x1 - bbox.x0) * (res / PX_PER_IN));
- unsigned height =(unsigned) floor ((bbox.y1 - bbox.y0) * (res / PX_PER_IN));
+ unsigned width = (unsigned) floor ((bbox->max()[Geom::X] - bbox->min()[Geom::X]) * (res / PX_PER_IN));
+ unsigned height =(unsigned) floor ((bbox->max()[Geom::Y] - bbox->min()[Geom::Y]) * (res / PX_PER_IN));
// Scale to exactly fit integer bitmap inside bounding box
- double scale_x = (bbox.x1 - bbox.x0) / width;
- double scale_y = (bbox.y1 - bbox.y0) / height;
+ double scale_x = (bbox->max()[Geom::X] - bbox->min()[Geom::X]) / width;
+ double scale_y = (bbox->max()[Geom::Y] - bbox->min()[Geom::Y]) / height;
// Location of bounding box in document coordinates.
- double shift_x = bbox.x0;
- double shift_y = bbox.y1;
+ double shift_x = bbox->min()[Geom::X];
+ double shift_y = bbox->max()[Geom::Y];
// For default 90 dpi, snap bitmap to pixel grid
if (res == PX_PER_IN) {
@@ -483,7 +487,8 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
items = g_slist_append(items, item);
GdkPixbuf *pb = sp_generate_internal_bitmap(document, NULL,
- bbox.x0, bbox.y0, bbox.x1, bbox.y1, width, height, res, res, (guint32) 0xffffff00, items );
+ bbox->min()[Geom::X], bbox->min()[Geom::Y], bbox->max()[Geom::X], bbox->max()[Geom::Y],
+ width, height, res, res, (guint32) 0xffffff00, items );
if (pb) {
TEST(gdk_pixbuf_save( pb, "bitmap.png", "png", NULL, NULL ));
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index a74e17a10..2e0082832 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -1496,7 +1496,7 @@ writePath(Writer &outs, Geom::PathVector const &pathv,
// convert the path to only lineto's and cubic curveto's:
Geom::PathVector pv = pathv_to_linear_and_cubic_beziers(pathv * tf * Geom::Translate(xoff, yoff) * Geom::Scale(1000.));
- for (Geom::PathVector::const_iterator pit = pathv.begin(); pit != pathv.end(); ++pit) {
+ for (Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit) {
double destx = pit->initialPoint()[X];
double desty = pit->initialPoint()[Y];
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index bf8fd2003..2a23b1115 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -171,6 +171,10 @@ sp_shape_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
if (((SPObjectClass *) (parent_class))->build) {
(*((SPObjectClass *) (parent_class))->build) (object, document, repr);
}
+
+ for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
+ sp_shape_set_marker (object, i, object->style->marker[i].value);
+ }
}
/**
@@ -196,10 +200,11 @@ sp_shape_release (SPObject *object)
for (i=SP_MARKER_LOC_START; i<SP_MARKER_LOC_QTY; i++) {
if (shape->marker[i]) {
- sp_signal_disconnect_by_data (shape->marker[i], object);
for (v = item->display; v != NULL; v = v->next) {
sp_marker_hide ((SPMarker *) shape->marker[i], NR_ARENA_ITEM_GET_KEY (v->arenaitem) + i);
}
+ shape->release_connect[i].disconnect();
+ shape->modified_connect[i].disconnect();
shape->marker[i] = sp_object_hunref (shape->marker[i], object);
}
}
@@ -894,7 +899,8 @@ sp_shape_marker_release (SPObject *marker, SPShape *shape)
/* nr_arena_item_set_mask (v->arenaitem, NULL); */
}
/* Detach marker */
- sp_signal_disconnect_by_data (shape->marker[i], item);
+ shape->release_connect[i].disconnect();
+ shape->modified_connect[i].disconnect();
shape->marker[i] = sp_object_hunref (shape->marker[i], item);
}
}