~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/sp-flowtext.cpp

  • Committer: cilix42
  • Date: 2008-09-18 17:48:42 UTC
  • Revision ID: cilix42@users.sourceforge.net-20080918174842-1ad33a7d7gqhv2hq
Next roud of NR ==> Geom conversion

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
static void sp_flowtext_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
48
48
static void sp_flowtext_set(SPObject *object, unsigned key, gchar const *value);
49
49
 
50
 
static void sp_flowtext_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
 
50
static void sp_flowtext_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
51
51
static void sp_flowtext_print(SPItem *item, SPPrintContext *ctx);
52
52
static gchar *sp_flowtext_description(SPItem *item);
53
53
static NRArenaItem *sp_flowtext_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags);
176
176
    group->rebuildLayout();
177
177
 
178
178
    NRRect paintbox;
179
 
    sp_item_invoke_bbox(group, &paintbox, NR::identity(), TRUE);
 
179
    sp_item_invoke_bbox(group, &paintbox, Geom::identity(), TRUE);
180
180
    for (SPItemView *v = group->display; v != NULL; v = v->next) {
181
181
        group->_clearFlow(NR_ARENA_GROUP(v->arenaitem));
182
182
        nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
198
198
    if (flags & ( SP_OBJECT_STYLE_MODIFIED_FLAG )) {
199
199
        SPFlowtext *text = SP_FLOWTEXT(object);
200
200
        NRRect paintbox;
201
 
        sp_item_invoke_bbox(text, &paintbox, NR::identity(), TRUE);
 
201
        sp_item_invoke_bbox(text, &paintbox, Geom::identity(), TRUE);
202
202
        for (SPItemView* v = text->display; v != NULL; v = v->next) {
203
203
            text->_clearFlow(NR_ARENA_GROUP(v->arenaitem));
204
204
            nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
323
323
}
324
324
 
325
325
static void
326
 
sp_flowtext_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const /*flags*/)
 
326
sp_flowtext_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const /*flags*/)
327
327
{
328
328
    SPFlowtext *group = SP_FLOWTEXT(item);
329
329
    group->layout.getBoundingBox(bbox, transform);
331
331
    // Add stroke width
332
332
    SPStyle* style=SP_OBJECT_STYLE (item);
333
333
    if ( !style->stroke.isNone() ) {
334
 
        double const scale = expansion(transform);
 
334
        double const scale = transform.descrim();
335
335
        if ( fabs(style->stroke_width.computed * scale) > 0.01 ) { // sinon c'est 0=oon veut pas de bord
336
336
            double const width = MAX(0.125, style->stroke_width.computed * scale);
337
337
            if ( fabs(bbox->x1 - bbox->x0) > -0.00001 && fabs(bbox->y1 - bbox->y0) > -0.00001 ) {
350
350
    SPFlowtext *group = SP_FLOWTEXT(item);
351
351
 
352
352
    NRRect pbox;
353
 
    sp_item_invoke_bbox(item, &pbox, NR::identity(), TRUE);
 
353
    sp_item_invoke_bbox(item, &pbox, Geom::identity(), TRUE);
354
354
    NRRect bbox;
355
355
    boost::optional<NR::Rect> bbox_maybe = sp_item_bbox_desktop(item);
356
356
    if (!bbox_maybe) {
390
390
 
391
391
    // pass the bbox of the flowtext object as paintbox (used for paintserver fills)
392
392
    NRRect paintbox;
393
 
    sp_item_invoke_bbox(item, &paintbox, NR::identity(), TRUE);
 
393
    sp_item_invoke_bbox(item, &paintbox, Geom::identity(), TRUE);
394
394
    group->layout.show(flowed, &paintbox);
395
395
 
396
396
    return flowed;
556
556
            // set x,y attributes only when we need to
557
557
            bool set_x = false;
558
558
            bool set_y = false;
559
 
            if (!item->transform.test_identity()) {
 
559
            if (!item->transform.isIdentity()) {
560
560
                set_x = set_y = true;
561
561
            } else {
562
562
                Inkscape::Text::Layout::iterator it_chunk_start = it;