Merge branch 'master' into 'master'

[Mobile] enclosed check for FScrollPane drawOverlay

See merge request core-developers/forge!4058
This commit is contained in:
Anthony Calosa
2021-03-01 09:51:29 +00:00

View File

@@ -155,32 +155,36 @@ public abstract class FScrollPane extends FContainer {
@Override @Override
protected void drawOverlay(Graphics g) { protected void drawOverlay(Graphics g) {
boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay"); try {
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay");
//draw triangles indicating scroll potential //TODO: Consider other ways to indicate scroll potential that fade in and out based on input
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR)) //draw triangles indicating scroll potential
return; if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR))
if (!isFieldZoneView) return;
return; if (!isFieldZoneView)
if (scrollLeft > 0) { return;
float x = INDICATOR_MARGIN; if (scrollLeft > 0) {
float y = getHeight() / 2; float x = INDICATOR_MARGIN;
g.fillTriangle(INDICATOR_COLOR, x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE); 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; if (scrollLeft < getMaxScrollLeft()) {
float y = getHeight() / 2; float x = getWidth() - INDICATOR_MARGIN;
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x - INDICATOR_SIZE, y + INDICATOR_SIZE); 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; if (scrollTop > 0) {
float y = INDICATOR_MARGIN; float x = getWidth() / 2;
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y + INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE); 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; if (scrollTop < getMaxScrollTop()) {
float y = getHeight() - INDICATOR_MARGIN; float x = getWidth() / 2;
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE); 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();
} }
} }