mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Update FScrollPane.java
This commit is contained in:
committed by
Churrufli
parent
de76bf5d1d
commit
48b58f97e6
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user