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