~ubuntu-branches/ubuntu/precise/inkscape/precise-updates

« back to all changes in this revision

Viewing changes to src/display/nr-arena-glyphs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
    }
212
212
    if (nr_rect_d_test_empty(bbox)) return NR_ARENA_ITEM_STATE_ALL;
213
213
 
214
 
    item->bbox.x0 = (gint32)(bbox.x0 - 1.0);
215
 
    item->bbox.y0 = (gint32)(bbox.y0 - 1.0);
216
 
    item->bbox.x1 = (gint32)(bbox.x1 + 1.0);
217
 
    item->bbox.y1 = (gint32)(bbox.y1 + 1.0);
 
214
    item->bbox.x0 = static_cast<NR::ICoord>(floor(bbox.x0));
 
215
    item->bbox.y0 = static_cast<NR::ICoord>(floor(bbox.y0));
 
216
    item->bbox.x1 = static_cast<NR::ICoord>(ceil (bbox.x1));
 
217
    item->bbox.y1 = static_cast<NR::ICoord>(ceil (bbox.y1));
218
218
 
219
219
    return NR_ARENA_ITEM_STATE_ALL;
220
220
}
234
234
}
235
235
 
236
236
static NRArenaItem *
237
 
nr_arena_glyphs_pick(NRArenaItem *item, Geom::Point p, gdouble /*delta*/, unsigned int /*sticky*/)
 
237
nr_arena_glyphs_pick(NRArenaItem *item, Geom::Point p, gdouble delta, unsigned int /*sticky*/)
238
238
{
239
239
    NRArenaGlyphs *glyphs;
240
240
 
246
246
    double const x = p[Geom::X];
247
247
    double const y = p[Geom::Y];
248
248
    /* With text we take a simple approach: pick if the point is in a characher bbox */
249
 
    if ((x >= item->bbox.x0) && (y >= item->bbox.y0) && (x <= item->bbox.x1) && (y <= item->bbox.y1)) return item;
 
249
    if ((x + delta >= item->bbox.x0) && (y + delta >= item->bbox.y0) && (x - delta <= item->bbox.x1) && (y - delta <= item->bbox.y1)) return item;
250
250
 
251
251
    return NULL;
252
252
}
444
444
    SPStyle const *style = ggroup->style;
445
445
 
446
446
    guint ret = item->state;
 
447
    bool print_colors_preview = (item->arena->rendermode == Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
447
448
 
448
449
    if (item->arena->rendermode == Inkscape::RENDERMODE_OUTLINE) {
449
450
 
511
512
            } else {
512
513
                rgba = style->fill.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->fill_opacity.value) );
513
514
            }
 
515
 
 
516
            if (print_colors_preview)
 
517
                nr_arena_separate_color_plates(&rgba);
 
518
 
514
519
            nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
515
520
            pb->empty = FALSE;
516
521
        }
551
556
            } else {
552
557
                rgba = style->stroke.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->stroke_opacity.value) );
553
558
            }
 
559
 
 
560
            if (print_colors_preview)
 
561
                nr_arena_separate_color_plates(&rgba);
 
562
 
554
563
            nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
555
564
            pb->empty = FALSE;
556
565
        } else {