Shape.transform(trans…) results in incorrect x,y getX(), getY() values.

Issue #43 new
Jonas Waage
created an issue

Shape.transform(trans…) should (I think) return a new Shape with transformed x,y values, but instead x,y is reset to their base Shape values (0) and not updated. minX and minY are ok though, since they are found upon getMinX() and getMinY() where checkPoints() is called to find the values.

To me this seems to be a bug, but it might be that x,y differ from minX minY in some way I do not understand, and I am misusing it by using getX() getY().

Something like this should show the bug (the java one is a Kotlin translation so might not compile):

Shape area = new Rectangle(100,100,40,50);
Transform tr = Transform.createTranslateTransform(5f,5f);
System.out.println("Ok X: " + area.getX());
area = area.transform(tr);
System.out.println("Not 105 X: " + area.getX());
var area : Shape = Rectangle(100f,100f,4f,5f);
val tr = Transform.createTranslateTransform(5.toFloat(), 5.toFloat());
println("Ok X: " + area.getX());
area = area.transform(tr) as Shape;
println(":Not 105 X " + area.getX());

Comments (0)

  1. Log in to comment