Let us optionally not auto-reposition TransformedMirages; it was being smart
for things like scales and rotates so 0,0 still meant the same place, but that meant I couldn't just reposition something, since it would promptly undo the transform I passed in. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@256 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -38,17 +38,28 @@ public class TransformedMirage
|
|||||||
implements Mirage
|
implements Mirage
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor for backwards compatability that automatically repositions the
|
||||||
|
* transformed mirage so its new upper-left corner is still at the origin.
|
||||||
*/
|
*/
|
||||||
public TransformedMirage (Mirage base, AffineTransform transform)
|
public TransformedMirage (Mirage base, AffineTransform transform)
|
||||||
|
{
|
||||||
|
this(base, transform, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
public TransformedMirage (Mirage base, AffineTransform transform, boolean reposition)
|
||||||
{
|
{
|
||||||
_base = base;
|
_base = base;
|
||||||
|
|
||||||
// clone the transform so that it doesn't get changed on us.
|
// clone the transform so that it doesn't get changed on us.
|
||||||
_transform = (AffineTransform) transform.clone();
|
_transform = (AffineTransform) transform.clone();
|
||||||
computeTransformedBounds();
|
computeTransformedBounds();
|
||||||
_transform.preConcatenate(
|
if (reposition) {
|
||||||
AffineTransform.getTranslateInstance(-_bounds.x, -_bounds.y));
|
_transform.preConcatenate(
|
||||||
|
AffineTransform.getTranslateInstance(-_bounds.x, -_bounds.y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface Mirage
|
// documentation inherited from interface Mirage
|
||||||
|
|||||||
Reference in New Issue
Block a user