Fixed minimap zoom not resetting after map load

This commit is contained in:
Anuken
2019-04-24 09:12:33 -04:00
parent f332332eaa
commit eecaa850e0
2 changed files with 42 additions and 40 deletions

View File

@ -111,7 +111,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
ui.showError(Core.bundle.format("editor.errorload", Strings.parseException(e, false)));
Log.err(e);
}
}), true, "png")));
}), true, "png"))
);
t.addImageTextButton("$editor.export", "icon-save-map", isize, () ->
Platform.instance.showFileChooser("$editor.savemap", "Map Files", file -> {

View File

@ -25,7 +25,7 @@ public class MinimapRenderer implements Disposable{
private Pixmap pixmap;
private Texture texture;
private TextureRegion region;
private Rectangle rect = new Rectangle(), scissor = new Rectangle();
private Rectangle rect = new Rectangle();
private float zoom = 4;
public MinimapRenderer(){
@ -60,6 +60,7 @@ public class MinimapRenderer implements Disposable{
pixmap.dispose();
texture.dispose();
}
setZoom(4f);
pixmap = new Pixmap(world.width(), world.height(), Format.RGBA8888);
texture = new Texture(pixmap);
region = new TextureRegion(texture);