mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
[Android] enclosed check for FScrollPane drawOverlay
This commit is contained in:
@@ -155,32 +155,36 @@ public abstract class FScrollPane extends FContainer {
|
||||
|
||||
@Override
|
||||
protected void drawOverlay(Graphics g) {
|
||||
boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay");
|
||||
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input
|
||||
//draw triangles indicating scroll potential
|
||||
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR))
|
||||
return;
|
||||
if (!isFieldZoneView)
|
||||
return;
|
||||
if (scrollLeft > 0) {
|
||||
float x = INDICATOR_MARGIN;
|
||||
float y = getHeight() / 2;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollLeft < getMaxScrollLeft()) {
|
||||
float x = getWidth() - INDICATOR_MARGIN;
|
||||
float y = getHeight() / 2;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x - INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollTop > 0) {
|
||||
float x = getWidth() / 2;
|
||||
float y = INDICATOR_MARGIN;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y + INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollTop < getMaxScrollTop()) {
|
||||
float x = getWidth() / 2;
|
||||
float y = getHeight() - INDICATOR_MARGIN;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
|
||||
try {
|
||||
boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay");
|
||||
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input
|
||||
//draw triangles indicating scroll potential
|
||||
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR))
|
||||
return;
|
||||
if (!isFieldZoneView)
|
||||
return;
|
||||
if (scrollLeft > 0) {
|
||||
float x = INDICATOR_MARGIN;
|
||||
float y = getHeight() / 2;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollLeft < getMaxScrollLeft()) {
|
||||
float x = getWidth() - INDICATOR_MARGIN;
|
||||
float y = getHeight() / 2;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x - INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollTop > 0) {
|
||||
float x = getWidth() / 2;
|
||||
float y = INDICATOR_MARGIN;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y + INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||
}
|
||||
if (scrollTop < getMaxScrollTop()) {
|
||||
float x = getWidth() / 2;
|
||||
float y = getHeight() - INDICATOR_MARGIN;
|
||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user