~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/ui/view/edit-widget.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:
1375
1375
    //Geom::Point gridorigin = _namedview->gridorigin;
1376
1376
    /// \todo Why was the origin corrected for the grid origin? (johan)
1377
1377
    
1378
 
    Geom::Rect const viewbox = to_2geom(_svg_canvas.spobj()->getViewbox());
 
1378
    Geom::Rect const viewbox = _svg_canvas.spobj()->getViewbox();
1379
1379
    double lo, up, pos, max;
1380
1380
    double const scale = _desktop->current_zoom();
1381
1381
    double s = viewbox.min()[Geom::X] / scale; //- gridorigin[Geom::X];
1408
1408
    NR::Rect carea( Geom::Point(darea.min()[Geom::X] * scale - 64, darea.max()[Geom::Y] * -scale - 64),
1409
1409
                    Geom::Point(darea.max()[Geom::X] * scale + 64, darea.min()[Geom::Y] * -scale + 64)  );
1410
1410
 
1411
 
    NR::Rect const viewbox = _svg_canvas.spobj()->getViewbox();
 
1411
    Geom::Rect const viewbox = _svg_canvas.spobj()->getViewbox();
1412
1412
 
1413
1413
    /* Viewbox is always included into scrollable region */
1414
 
    carea = NR::union_bounds(carea, viewbox);
 
1414
    carea = NR::union_bounds(carea, from_2geom(viewbox));
1415
1415
 
1416
1416
    Gtk::Adjustment *adj = _bottom_scrollbar.get_adjustment();
1417
1417
    adj->set_value(viewbox.min()[Geom::X]);
1642
1642
        return;
1643
1643
    }
1644
1644
 
1645
 
    Geom::Rect const area = to_2geom(_desktop->get_display_area());
 
1645
    Geom::Rect const area = _desktop->get_display_area();
1646
1646
    double zoom = _desktop->current_zoom();
1647
1647
 
1648
1648
    if (_sticky_zoom.get_active()) {
1649
1649
        /* Calculate zoom per pixel */
1650
1650
        double const zpsp = zoom / hypot(area.dimensions()[Geom::X], area.dimensions()[Geom::Y]);
1651
1651
        /* Find new visible area */
1652
 
        Geom::Rect const newarea = to_2geom(_desktop->get_display_area());
 
1652
        Geom::Rect const newarea = _desktop->get_display_area();
1653
1653
        /* Calculate adjusted zoom */
1654
1654
        zoom = zpsp * hypot(newarea.dimensions()[Geom::X], newarea.dimensions()[Geom::Y]);
1655
1655
    }