mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-08-04 00:49:32 +07:00
Fixed flip not taking into account offset
This commit is contained in:
@ -262,15 +262,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void flipRequests(Array<BuildRequest> requests, boolean x){
|
public void flipRequests(Array<BuildRequest> requests, boolean x){
|
||||||
int origin = x ? rawTileX() : rawTileY();
|
int origin = (x ? rawTileX() : rawTileY()) * tilesize;
|
||||||
|
|
||||||
requests.each(req -> {
|
requests.each(req -> {
|
||||||
int value = -((x ? req.x : req.y) - origin) + origin;
|
float value = -((x ? req.x : req.y) * tilesize - origin + req.block.offset()) + origin;
|
||||||
|
|
||||||
if(x){
|
if(x){
|
||||||
req.x = value;
|
req.x = (int)((value - req.block.offset()) / tilesize);
|
||||||
}else{
|
}else{
|
||||||
req.y = value;
|
req.y = (int)((value - req.block.offset()) / tilesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(req.block.posConfig){
|
if(req.block.posConfig){
|
||||||
|
Reference in New Issue
Block a user