~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/extension/internal/grid.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
namespace {
48
48
 
49
 
Glib::ustring build_lines(int axis, NR::Rect bounding_area,
 
49
Glib::ustring build_lines(int axis, Geom::Rect bounding_area,
50
50
                          float offset, float spacing)
51
51
{
52
 
    NR::Point point_offset(0.0, 0.0);
 
52
    Geom::Point point_offset(0.0, 0.0);
53
53
    point_offset[axis] = offset;
54
54
 
55
55
    SVG::PathString path_data;
56
 
    for (NR::Point start_point = bounding_area.min();
 
56
    for (Geom::Point start_point = bounding_area.min();
57
57
            start_point[axis] + offset <= (bounding_area.max())[axis];
58
58
            start_point[axis] += spacing) {
59
 
        NR::Point end_point = start_point;
 
59
        Geom::Point end_point = start_point;
60
60
        end_point[1-axis] = (bounding_area.max())[1-axis];
61
61
 
62
62
        path_data.moveTo(start_point + point_offset)
78
78
{
79
79
    Inkscape::Selection * selection     = ((SPDesktop *)document)->selection;
80
80
 
81
 
    NR::Rect bounding_area = NR::Rect(NR::Point(0,0), NR::Point(100,100));
 
81
    Geom::Rect bounding_area = Geom::Rect(Geom::Point(0,0), Geom::Point(100,100));
82
82
    if (selection->isEmpty()) {
83
83
        /* get page size */
84
84
        SPDocument * doc = document->doc();
85
 
        bounding_area = NR::Rect(NR::Point(0,0),
86
 
                                 NR::Point(sp_document_width(doc),
87
 
                                           sp_document_height(doc)));
 
85
        bounding_area = Geom::Rect(  Geom::Point(0,0),
 
86
                                     Geom::Point(sp_document_width(doc), sp_document_height(doc))  );
88
87
    } else {
89
 
        NR::Maybe<NR::Rect> bounds = selection->bounds();
 
88
        Geom::OptRect bounds = selection->bounds();
90
89
        if (bounds) {
91
90
            bounding_area = *bounds;
92
91
        }
93
92
 
94
93
        gdouble doc_height  =  sp_document_height(document->doc());
95
 
        NR::Rect temprec = NR::Rect(NR::Point(bounding_area.min()[NR::X], doc_height - bounding_area.min()[NR::Y]),
96
 
                                    NR::Point(bounding_area.max()[NR::X], doc_height - bounding_area.max()[NR::Y]));
 
94
        Geom::Rect temprec = Geom::Rect(Geom::Point(bounding_area.min()[Geom::X], doc_height - bounding_area.min()[Geom::Y]),
 
95
                                    Geom::Point(bounding_area.max()[Geom::X], doc_height - bounding_area.max()[Geom::Y]));
97
96
 
98
97
        bounding_area = temprec;
99
98
    }
125
124
    path->setAttribute("style", style.c_str());
126
125
 
127
126
    current_layer->appendChild(path);
 
127
                Inkscape::GC::release(path);
128
128
 
129
129
    return;
130
130
}
188
188
Grid::init (void)
189
189
{
190
190
    Inkscape::Extension::build_from_mem(
191
 
        "<inkscape-extension>\n"
 
191
        "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
192
192
            "<name>" N_("Grid") "</name>\n"
193
193
            "<id>org.inkscape.effect.grid</id>\n"
194
194
            "<param name=\"lineWidth\" gui-text=\"" N_("Line Width") "\" type=\"float\">1.0</param>\n"