Logo Search packages:      
Sourcecode: inkscape version File versions

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

Zoom to point with relative zoom factor.

Definition at line 780 of file desktop.cpp.

References NR::Rect::dimensions(), get_display_area(), NR::Rect::max(), NR::Rect::min(), and zoom_absolute_keep_point().

Referenced by sp_event_context_private_root_handler().

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

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

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

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


Generated by  Doxygen 1.6.0   Back to index