Example #1
0
// SetTransformation
void
ChannelTransform::SetTransformation(const Transformable& other)
{
	// calc affine parameters

	// translation
	double tx;
	double ty;
	other.translation(&tx, &ty);

	// rotation
	double rotation = agg::rad2deg(other.rotation());

	// scale
	double scaleX;
	double scaleY;
	other.scaling(&scaleX, &scaleY);

	if (isnanf(tx) || isnanf(ty) || isnanf(scaleX) || isnanf(scaleY))
		return;

	SetTransformation(B_ORIGIN, BPoint(tx, ty), rotation, scaleX, scaleY);
}