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

NR::Matrix sp_gradient_get_g2d_matrix ( SPGradient const *  gr,
NR::Matrix const &  ctm,
NR::Rect const &  bbox 
)

Transforms to/from gradient position space in given environment

Definition at line 1255 of file sp-gradient.cpp.

References NR::Rect::dimensions(), NR::Rect::min(), and SPGradient::units.

{
    if (gr->units == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
        return ( NR::scale(bbox.dimensions())
                 * NR::translate(bbox.min())
                 * ctm );
    } else {
        return ctm;
    }
}


Generated by  Doxygen 1.6.0   Back to index