Revision: 4388
http://vassalengine.svn.sourceforge.net/vassalengine/?rev=4388&view=rev
Author: uckelman
Date: 2008-11-05 21:31:43 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
Merged from swampwallaby-work 4360.
Fixed Bug 2202296: Hang when moving trait up.
Modified Paths:
--------------
VASSAL-src/trunk/src/VASSAL/counters/FreeRotator.java
Modified: VASSAL-src/trunk/src/VASSAL/counters/FreeRotator.java
===================================================================
--- VASSAL-src/trunk/src/VASSAL/counters/FreeRotator.java 2008-11-05 20:57:12 UTC (rev 4387)
+++ VASSAL-src/trunk/src/VASSAL/counters/FreeRotator.java 2008-11-05 21:31:43 UTC (rev 4388)
@@ -128,8 +128,10 @@
}
public void setInner(GamePiece p) {
- gpOp = p == null ? null : Op.piece(p);
- super.setInner(p);
+ // The GamePiece stack can be in an invalid state during a setInner()
+ // call, so cannot regenerate gpOp now.
+ gpOp = null;
+ super.setInner(p);
}
private double centerX() {
@@ -151,7 +153,7 @@
}
Rectangle r;
- if (gpOp.isChanged() || (r = bounds.get(angle)) == null) {
+ if ((getGpOp() != null && getGpOp().isChanged()) || (r = bounds.get(angle)) == null) {
r = AffineTransform.getRotateInstance(getAngleInRadians(),
centerX(),
@@ -162,6 +164,15 @@
return new Rectangle(r);
}
+ protected GamePieceOp getGpOp() {
+ if (gpOp == null) {
+ if (getInner() != null) {
+ gpOp = Op.piece(getInner());
+ }
+ }
+ return gpOp;
+ }
+
public double getAngle() {
return useUnrotatedShape ? 0.0 : validAngles[angleIndex];
}
@@ -260,7 +271,7 @@
final double angle = getAngle();
RotateScaleOp op;
- if (gpOp.isChanged()) {
+ if (getGpOp() != null && getGpOp().isChanged()) {
gpOp = Op.piece(piece);
rotOp.clear();
op = Op.rotateScale(gpOp, angle, zoom);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
vassalengine-svn mailing list
vassalengine-svn@...
https://lists.sourceforge.net/lists/listinfo/vassalengine-svn
|