From c9e969c7b42fdec99fb667edc66939967b8b263b Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 30 Sep 2019 21:45:25 -0400 Subject: [PATCH] Editor scroll fix --- core/src/io/anuke/mindustry/editor/MapEditorDialog.java | 5 +++++ core/src/io/anuke/mindustry/editor/MapView.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index c9b04ad256..b7b1d2345d 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -680,6 +680,11 @@ public class MapEditorDialog extends Dialog implements Disposable{ pane = new ScrollPane(content); pane.setFadeScrollBars(false); pane.setOverscroll(true, false); + pane.exited(() -> { + if(pane.hasScroll()){ + Core.scene.setScrollFocus(view); + } + }); ButtonGroup group = new ButtonGroup<>(); int i = 0; diff --git a/core/src/io/anuke/mindustry/editor/MapView.java b/core/src/io/anuke/mindustry/editor/MapView.java index 2e06352e49..c637e9b6f2 100644 --- a/core/src/io/anuke/mindustry/editor/MapView.java +++ b/core/src/io/anuke/mindustry/editor/MapView.java @@ -56,10 +56,16 @@ public class MapView extends Element implements GestureListener{ public boolean mouseMoved(InputEvent event, float x, float y){ mousex = x; mousey = y; + requestScroll(); return false; } + @Override + public void enter(InputEvent event, float x, float y, int pointer, Element fromActor){ + requestScroll(); + } + @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ if(pointer != 0){