Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void SPDesktop::zoom_relative_keep_point ( double  cx,
double  cy,
double  zoom 
)

Zoom to point with relative zoom factor.

Definition at line 1009 of file desktop.cpp.

References Geom::Matrix::descrim(), Geom::D2< Interval >::dimensions(), get_display_area(), and zoom_absolute_keep_point().

Referenced by Inkscape::ZoomVerb::perform(), and sp_event_context_private_root_handler().

{
    Geom::Rect const area = get_display_area();

    if (cx < area.min()[Geom::X]) {
        cx = area.min()[Geom::X];
    }
    if (cx > area.max()[Geom::X]) {
        cx = area.max()[Geom::X];
    }
    if (cy < area.min()[Geom::Y]) {
        cy = area.min()[Geom::Y];
    }
    if (cy > area.max()[Geom::Y]) {
        cy = area.max()[Geom::Y];
    }

    gdouble const scale = _d2w.descrim() * zoom;
    double const px = (cx - area.min()[Geom::X]) / area.dimensions()[Geom::X];
    double const py = (cy - area.min()[Geom::Y]) / area.dimensions()[Geom::Y];

    zoom_absolute_keep_point(cx, cy, px, py, scale);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index