I’m very new to this sort of thing, so I’m not sure what the process is for bug fixes/code modification suggestions.
Recently the Malifaux module updated from Vassal 3.2.7 to 3.4.3. This introduced an issue with the ‘Move Fixed Distance’(MFD) trait on the models, as they have 2 MFD traits - one above the ‘Can Rotate’ trait which is designed to follow the piece rotation and one below it which is designed to remain unrotated.
Between the versions, the Translate code was modified to retrieve the highest FreeRotator decorator if it failed to find one below it, thus breaking the trait ordering:
// Handle rotation of the piece, movement is relative to the current facing of the unit.
// Use the first Rotator trait below us, if none, use the highest in the stack.
FreeRotator myRotation = (FreeRotator) Decorator.getDecorator(this, FreeRotator.class);
if (myRotation == null) {
myRotation = (FreeRotator) Decorator.getDecorator(Decorator.getOutermost(this), FreeRotator.class);
}
Additionally, after applying the rotation, the floating point values are truncated with an (int) cast without being rounded first, causing models to drift up and left as they’re moved, and breaking the inverse relationship of forward/backward movement
if (myRotation != null) {
Point2D myPosition = getPosition().getLocation();
Point2D p2d = p.getLocation();
p2d = AffineTransform.getRotateInstance(myRotation.getCumulativeAngleInRadians(), myPosition.getX(), myPosition.getY()).transform(p2d, null);
p = new Point((int) p2d.getX(), (int) p2d.getY());
}
I would like to add a request that the following lines be removed:
if (myRotation == null) {
myRotation = (FreeRotator) Decorator.getDecorator(Decorator.getOutermost(this), FreeRotator.class);
}
And that this line:
p = new Point((int) p2d.getX(), (int) p2d.getY());
be modified to this:
p = new Point((int) Math.round(p2d.getX()), (int) Math.round(p2d.getY()));
How do I go about suggesting code changes? Do I need to make a bug report describing the issue, and then submit a pull request? Also, how does one go about submitting a pull request?