Logo Search packages:      
Sourcecode: inkscape version File versions

void SPItem::setCenter ( NR::Point  object_centre  )  [inherited]

Sets the transform_center_x and transform_center_y properties to retain the rotation centre

Definition at line 286 of file sp-item.cpp.

                                       {
    NR::Maybe<NR::Rect> bbox = getBounds(sp_item_i2d_affine(this));
    if (bbox) {
        transform_center_x = object_centre[NR::X] - bbox->midpoint()[NR::X];
        if (fabs(transform_center_x) < 1e-5) // rounding error
            transform_center_x = 0;
        transform_center_y = object_centre[NR::Y] - bbox->midpoint()[NR::Y];
        if (fabs(transform_center_y) < 1e-5) // rounding error
            transform_center_y = 0;
    }
}


Generated by  Doxygen 1.6.0   Back to index