Update FScrollPane.java

This commit is contained in:
Anthony Calosa
2021-03-01 10:03:26 +00:00
committed by Churrufli
parent de76bf5d1d
commit 48b58f97e6

View File

@@ -157,12 +157,13 @@ public abstract class FScrollPane extends FContainer {
protected void drawOverlay(Graphics g) { protected void drawOverlay(Graphics g) {
try { try {
boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay"); boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay");
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input //if ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR is missing this will return NPE and could cause lockup on Startup
//draw triangles indicating scroll potential
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR)) if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR))
return; return;
if (!isFieldZoneView) if (!isFieldZoneView)
return; return;
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input
//draw triangles indicating scroll potential
if (scrollLeft > 0) { if (scrollLeft > 0) {
float x = INDICATOR_MARGIN; float x = INDICATOR_MARGIN;
float y = getHeight() / 2; float y = getHeight() / 2;
@@ -183,9 +184,7 @@ public abstract class FScrollPane extends FContainer {
float y = getHeight() - INDICATOR_MARGIN; float y = getHeight() - INDICATOR_MARGIN;
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE); g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
} }
} catch (Exception e) { } catch (Exception e) {}
e.printStackTrace();
}
} }
//allow overriding to adjust what scroll positions are restored after layout //allow overriding to adjust what scroll positions are restored after layout