Another way of managing this is to keep various decomposed values around
and then compose the matrix only at render time.
For example, if you want to independently control scaling and rotation and
set limits on them:
On mouse motion:
if (scaling motion) {
scale = scale +*/- motion delta;
if (scale out of range) {
set scale to range limit;
}
} else {
// rotation motion
rotation = rotation +*/- motion delta;
if (rotation out of range) {
set rotation to range limit;
}
}
In paint routine:
g2d.scale(scale, scale);
g2d.rotate(rotation);
// Or similar operations on a fresh AffineTransform object
That makes it easier to manage limits on the relative constituent
transformation components without having to worry about the mathematics of
how they got combined into a single transformation matrix...
...jim
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".