diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index f62c584c3bf03236785a6786ecdb4df6bd19fb99..cdd356871c80d5d840c695a3d05b199ac28c297a 100644 (file)
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
SPObject *object = doc->getObjectById(name);
if (object && SP_IS_ITEM(object)) {
/* Find bbox in document */
- NR::Matrix const i2doc(from_2geom(sp_item_i2doc_affine(SP_ITEM(object))));
- NR::Maybe<NR::Rect> dbox = SP_ITEM(object)->getBounds(i2doc);
+ Geom::Matrix const i2doc(sp_item_i2doc_affine(SP_ITEM(object)));
+ boost::optional<NR::Rect> nrdbox = SP_ITEM(object)->getBounds(i2doc);
+ boost::optional<Geom::Rect> dbox;
+ if (nrdbox) {
+ dbox = to_2geom(*nrdbox);
+ }
if ( SP_OBJECT_PARENT(object) == NULL )
{
- dbox = NR::Rect(NR::Point(0, 0),
- NR::Point(sp_document_width(doc), sp_document_height(doc)));
+ dbox = Geom::Rect(Geom::Point(0, 0),
+ Geom::Point(sp_document_width(doc), sp_document_height(doc)));
}
/* This is in document coordinates, i.e. pixels */
NRGC gc(NULL);
/* Update to renderable state */
double sf = 1.0;
- nr_arena_item_set_transform(root, NR::Matrix(NR::scale(sf, sf)));
+ nr_arena_item_set_transform(root, (Geom::Matrix)Geom::Scale(sf, sf));
gc.transform.set_identity();
nr_arena_item_invoke_update( root, NULL, &gc,
NR_ARENA_ITEM_STATE_ALL,
NR_ARENA_ITEM_STATE_NONE );
/* Item integer bbox in points */
NRRectL ibox;
- ibox.x0 = (int) floor(sf * dbox->min()[NR::X] + 0.5);
- ibox.y0 = (int) floor(sf * dbox->min()[NR::Y] + 0.5);
- ibox.x1 = (int) floor(sf * dbox->max()[NR::X] + 0.5);
- ibox.y1 = (int) floor(sf * dbox->max()[NR::Y] + 0.5);
+ ibox.x0 = (int) floor(sf * dbox->min()[Geom::X] + 0.5);
+ ibox.y0 = (int) floor(sf * dbox->min()[Geom::Y] + 0.5);
+ ibox.x1 = (int) floor(sf * dbox->max()[Geom::X] + 0.5);
+ ibox.y1 = (int) floor(sf * dbox->max()[Geom::Y] + 0.5);
if ( dump ) {
g_message( " box --'%s' (%f,%f)-(%f,%f)", name, (double)ibox.x0, (double)ibox.y0, (double)ibox.x1, (double)ibox.y1 );
}
sf = (double)psize / (double)block;
- nr_arena_item_set_transform(root, NR::Matrix(NR::scale(sf, sf)));
+ nr_arena_item_set_transform(root, (Geom::Matrix)Geom::Scale(sf, sf));
gc.transform.set_identity();
nr_arena_item_invoke_update( root, NULL, &gc,
NR_ARENA_ITEM_STATE_ALL,
NR_ARENA_ITEM_STATE_NONE );
/* Item integer bbox in points */
- ibox.x0 = (int) floor(sf * dbox->min()[NR::X] + 0.5);
- ibox.y0 = (int) floor(sf * dbox->min()[NR::Y] + 0.5);
- ibox.x1 = (int) floor(sf * dbox->max()[NR::X] + 0.5);
- ibox.y1 = (int) floor(sf * dbox->max()[NR::Y] + 0.5);
+ ibox.x0 = (int) floor(sf * dbox->min()[Geom::X] + 0.5);
+ ibox.y0 = (int) floor(sf * dbox->min()[Geom::Y] + 0.5);
+ ibox.x1 = (int) floor(sf * dbox->max()[Geom::X] + 0.5);
+ ibox.y1 = (int) floor(sf * dbox->max()[Geom::Y] + 0.5);
if ( dump ) {
g_message( " box2 --'%s' (%f,%f)-(%f,%f)", name, (double)ibox.x0, (double)ibox.y0, (double)ibox.x1, (double)ibox.y1 );
}
}
-void imageMapCB(GtkWidget* widget, gpointer user_data) {
+void imageMapCB(GtkWidget* widget, gpointer /*user_data*/) {
gchar* id = 0;
GtkIconSize size = GTK_ICON_SIZE_INVALID;
gtk_image_get_stock(GTK_IMAGE(widget), &id, &size);