Example #1
0
Rotater::Rotater(Rotation& rot, const Rotation& by)
    : old(rot)
    , rot(rot)
{
    // apply rotation
    rot.origin = rot.tr(by.origin);
    rot.size   = by.size;
    rot.angle  = constrain_radians(rot.angle + by.angle);
    // zooming is not really correct if rot.zoomX != rot.zoomY
    rot.zoomX *= by.zoomX;
    rot.zoomY *= by.zoomY;
}