From 754b97f48cd23a2a178a121917a3e58a609fc3c2 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Sun, 18 Apr 2010 16:17:05 +0200 Subject: Fix for bug #455302 and bug #165529, also partially fixes bounding box of various NR Arena Items as passed to filters (it used to explicitly make the bounding box larger) and makes nr-filter-displacement-map use rowstride (bzr r9350) --- src/display/nr-arena-image.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/display/nr-arena-image.cpp') diff --git a/src/display/nr-arena-image.cpp b/src/display/nr-arena-image.cpp index f45a2da4f..493943168 100644 --- a/src/display/nr-arena-image.cpp +++ b/src/display/nr-arena-image.cpp @@ -151,10 +151,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(floor(bbox.x0)); // Floor gives the coordinate in which the point resides + item->bbox.y0 = static_cast(floor(bbox.y0)); + item->bbox.x1 = static_cast(ceil (bbox.x1)); // Ceil gives the first coordinate beyond the point + item->bbox.y1 = static_cast(ceil (bbox.y1)); } else { item->bbox.x0 = (int) gc->transform[4]; item->bbox.y0 = (int) gc->transform[5]; @@ -211,13 +211,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; -- cgit v1.2.3