~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/text-context.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:
215
215
    sp_canvas_item_hide(tc->cursor);
216
216
 
217
217
    tc->indicator = sp_canvas_item_new(sp_desktop_controls(desktop), SP_TYPE_CTRLRECT, NULL);
218
 
    SP_CTRLRECT(tc->indicator)->setRectangle(NR::Rect(NR::Point(0, 0), NR::Point(100, 100)));
 
218
    SP_CTRLRECT(tc->indicator)->setRectangle(Geom::Rect(Geom::Point(0, 0), Geom::Point(100, 100)));
219
219
    SP_CTRLRECT(tc->indicator)->setColor(0x0000ff7f, false, 0);
220
220
    sp_canvas_item_hide(tc->indicator);
221
221
 
222
222
    tc->frame = sp_canvas_item_new(sp_desktop_controls(desktop), SP_TYPE_CTRLRECT, NULL);
223
 
    SP_CTRLRECT(tc->frame)->setRectangle(NR::Rect(NR::Point(0, 0), NR::Point(100, 100)));
 
223
    SP_CTRLRECT(tc->frame)->setRectangle(Geom::Rect(Geom::Point(0, 0), Geom::Point(100, 100)));
224
224
    SP_CTRLRECT(tc->frame)->setColor(0x0000ff7f, false, 0);
225
225
    sp_canvas_item_hide(tc->frame);
226
226
 
437
437
            item_ungrouped = desktop->item_at_point(NR::Point(event->button.x, event->button.y), TRUE);
438
438
            if (SP_IS_TEXT(item_ungrouped) || SP_IS_FLOWTEXT(item_ungrouped)) {
439
439
                sp_canvas_item_show(tc->indicator);
440
 
                boost::optional<NR::Rect> ibbox = sp_item_bbox_desktop(item_ungrouped);
 
440
                boost::optional<Geom::Rect> ibbox = to_2geom(sp_item_bbox_desktop(item_ungrouped));
441
441
                if (ibbox) {
442
442
                    SP_CTRLRECT(tc->indicator)->setRectangle(*ibbox);
443
443
                }
815
815
                        int screenlines = 1;
816
816
                        if (tc->text) {
817
817
                            double spacing = sp_te_get_average_linespacing(tc->text);
818
 
                            NR::Rect const d = desktop->get_display_area();
819
 
                            screenlines = (int) floor(fabs(d.min()[NR::Y] - d.max()[NR::Y])/spacing) - 1;
 
818
                            Geom::Rect const d = desktop->get_display_area();
 
819
                            screenlines = (int) floor(fabs(d.min()[Geom::Y] - d.max()[Geom::Y])/spacing) - 1;
820
820
                            if (screenlines <= 0)
821
821
                                screenlines = 1;
822
822
                        }
1599
1599
            SPItem *frame = SP_FLOWTEXT(tc->text)->get_frame (NULL); // first frame only
1600
1600
            if (frame) {
1601
1601
                sp_canvas_item_show(tc->frame);
1602
 
                boost::optional<NR::Rect> frame_bbox = sp_item_bbox_desktop(frame);
 
1602
                boost::optional<Geom::Rect> frame_bbox = to_2geom(sp_item_bbox_desktop(frame));
1603
1603
                if (frame_bbox) {
1604
1604
                    SP_CTRLRECT(tc->frame)->setRectangle(*frame_bbox);
1605
1605
                }