mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-11-11 03:31:19 +03:00
Fixed minor bug with camera panning out of bounds
This commit is contained in:
parent
bca8271c07
commit
ec0aa2d2f3
@ -13,6 +13,7 @@ import io.anuke.mindustry.input.GestureHandler;
|
||||
import io.anuke.mindustry.input.Input;
|
||||
import io.anuke.mindustry.world.Generator;
|
||||
import io.anuke.mindustry.world.blocks.ProductionBlocks;
|
||||
import io.anuke.ucore.UCore;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.entities.Entities;
|
||||
import io.anuke.ucore.graphics.Atlas;
|
||||
@ -23,7 +24,6 @@ import io.anuke.ucore.util.Timers;
|
||||
public class Control extends RendererModule{
|
||||
public int rangex = 10, rangey = 10;
|
||||
public float targetzoom = 1f;
|
||||
private float targetx, targety;
|
||||
//GifRecorder recorder = new GifRecorder(batch);
|
||||
|
||||
public Control(){
|
||||
@ -148,8 +148,15 @@ public class Control extends RendererModule{
|
||||
}
|
||||
|
||||
updateShake();
|
||||
float prevx = camera.position.x, prevy = camera.position.y;
|
||||
clampCamera(-tilesize / 2f, -tilesize / 2f, pixsize - tilesize / 2f, pixsize - tilesize / 2f);
|
||||
|
||||
if(android){
|
||||
UCore.log(camera.position.x-prevx, camera.position.y-prevy);
|
||||
player.x += camera.position.x-prevx;
|
||||
player.y += camera.position.y-prevy;
|
||||
}
|
||||
|
||||
float lastx = camera.position.x, lasty = camera.position.y;
|
||||
|
||||
if(android){
|
||||
|
@ -104,6 +104,8 @@ public class AndroidInput extends InputAdapter{
|
||||
|
||||
Tile sel = selected();
|
||||
|
||||
if(sel == null) return;
|
||||
|
||||
if(warmup > warmupDelay && sel.block() != ProductionBlocks.core && sel.breakable()){
|
||||
breaktime += Mathf.delta();
|
||||
|
||||
|
@ -45,8 +45,6 @@ public class GestureHandler extends GestureAdapter{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean pinch (Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {
|
||||
if(recipe == null)
|
||||
|
Loading…
Reference in New Issue
Block a user