Code

Tablet auto-organization and naming.
[inkscape.git] / src / display / nr-arena-image.cpp
index 52f6278e4a924813efbce0de839da42e7f3eb1ce..ec11d9ed171b71eb0b28303156ec6e59c710235c 100644 (file)
@@ -92,6 +92,7 @@ nr_arena_image_init (NRArenaImage *image)
     image->grid2px.setIdentity();
 
     image->style = 0;
+    image->render_opacity = TRUE;
 }
 
 static void
@@ -151,10 +152,10 @@ nr_arena_image_update( NRArenaItem *item, NRRectL */*area*/, NRGC *gc, unsigned
 
         nr_rect_d_matrix_transform (&bbox, &bbox, gc->transform);
 
-        item->bbox.x0 = (int) floor (bbox.x0);
-        item->bbox.y0 = (int) floor (bbox.y0);
-        item->bbox.x1 = (int) ceil (bbox.x1);
-        item->bbox.y1 = (int) ceil (bbox.y1);
+        item->bbox.x0 = static_cast<NR::ICoord>(floor(bbox.x0)); // Floor gives the coordinate in which the point resides
+        item->bbox.y0 = static_cast<NR::ICoord>(floor(bbox.y0));
+        item->bbox.x1 = static_cast<NR::ICoord>(ceil (bbox.x1)); // Ceil gives the first coordinate beyond the point
+        item->bbox.y1 = static_cast<NR::ICoord>(ceil (bbox.y1));
     } else {
         item->bbox.x0 = (int) gc->transform[4];
         item->bbox.y0 = (int) gc->transform[5];
@@ -211,13 +212,7 @@ nr_arena_image_render( cairo_t *ct, NRArenaItem *item, NRRectL */*area*/, NRPixB
         } else if (pb->mode == NR_PIXBLOCK_MODE_R8G8B8A8P) {
             nr_R8G8B8A8_P_R8G8B8A8_P_R8G8B8A8_N_TRANSFORM (dpx, dw, dh, drs, spx, sw, sh, srs, d2s, Falpha, nr_arena_image_x_sample, nr_arena_image_y_sample);
         } else if (pb->mode == NR_PIXBLOCK_MODE_R8G8B8A8N) {
-
-            //FIXME: The _N_N_N_ version gives a gray border around images, see bug 906376
-            // This mode is only used when exporting, screen rendering always has _P_P_P_, so I decided to simply replace it for now
-            // Feel free to propose a better fix
-
-            //nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_N_TRANSFORM (dpx, dw, dh, drs, spx, sw, sh, srs, d2s, Falpha, nr_arena_image_x_sample, nr_arena_image_y_sample);
-            nr_R8G8B8A8_P_R8G8B8A8_P_R8G8B8A8_N_TRANSFORM (dpx, dw, dh, drs, spx, sw, sh, srs, d2s, Falpha, nr_arena_image_x_sample, nr_arena_image_y_sample);
+            nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_N_TRANSFORM (dpx, dw, dh, drs, spx, sw, sh, srs, d2s, Falpha, nr_arena_image_x_sample, nr_arena_image_y_sample);
         }
 
         pb->empty = FALSE;
@@ -380,6 +375,8 @@ void nr_arena_image_set_style (NRArenaImage *image, SPStyle *style)
         && style->enable_background.value == SP_CSS_BACKGROUND_NEW) {
         image->background_new = true;
     }
+
+    nr_arena_item_request_update(image, NR_ARENA_ITEM_STATE_ALL, FALSE);
 }