fix: correction bogue lors de rotation des transmuteurs.
This commit is contained in:
parent
ea15e1e37c
commit
90609b9597
|
@ -84,12 +84,12 @@ public class Transhower extends Actor {
|
|||
float change=0;
|
||||
boolean dir=false;
|
||||
if (keepaspectratio) {
|
||||
change=Math.abs(deltax-deltay);
|
||||
if (change<0) {
|
||||
change=deltax-deltay;
|
||||
if (change>0) {
|
||||
deltay=deltax;
|
||||
dir=true;
|
||||
}
|
||||
else if (change>0) {
|
||||
else if (change<0) {
|
||||
deltax=deltay;
|
||||
dir=false;
|
||||
}
|
||||
|
@ -105,12 +105,12 @@ public class Transhower extends Actor {
|
|||
float sizey=AssetLoader.height/(this.getHeight()/deltay);
|
||||
float decx = -this.getX()/AssetLoader.width*sizex;
|
||||
float decy = -this.getY()/AssetLoader.height*sizey;
|
||||
if (change!=0)
|
||||
if (keepaspectratio && change!=0)
|
||||
if (dir)
|
||||
decy=decy-change/2;
|
||||
decy=decy-Math.abs(change/2);
|
||||
else
|
||||
decx=decx-change/2;
|
||||
Gdx.app.debug("wirechem-Transhower", "Camera dec:"+decx+","+decy+" view:"+sizex+","+sizey+" change:"+change+","+dir);
|
||||
decx=decx-Math.abs(change/2);
|
||||
Gdx.app.debug("wirechem-Transhower", "Camera delta:"+deltax+","+deltay+" dec:"+decx+","+decy+" view:"+sizex+","+sizey+" change:"+change+","+dir);
|
||||
camera.setToOrtho(false, sizex, sizey);
|
||||
camera.translate(decx,decy);
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ public class LevelScreen implements Screen {
|
|||
}
|
||||
|
||||
public LevelScreen(Worlds aworlds) {
|
||||
test=new Transhower(AssetLoader.getTransmuter("<>"),Transmuter.Angular.A90,true, new Color(0,1f,0f,1f));
|
||||
test=new Transhower(AssetLoader.getTransmuter("--"),Transmuter.Angular.A270,true, new Color(0,1f,0f,1f));
|
||||
test.setPosition(1920/2, 70);
|
||||
test.setWidth(512);
|
||||
test.setHeight(512);
|
||||
|
|
Loading…
Reference in New Issue