MCPcopy Create free account
hub / github.com/Card-Forge/forge / drawOverlay

Method drawOverlay

forge-gui-mobile/src/forge/menu/FDropDown.java:202–233  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

200 }
201
202 @Override
203 protected void drawOverlay(Graphics g) {
204 super.drawOverlay(g);
205 float w = getWidth();
206 float h = getHeight();
207 g.drawRect(2, getBorderColor(), 0, 0, w, h); //ensure border shows up on all sides
208 if (getDropDownOwner() instanceof FMenuTab) {
209 try {
210 if (getScrollLeft() > 0) {
211 float x = getIndicatorMargin();
212 float y = getHeight() / 2;
213 g.fillTriangle(getIndicatorColor(), x, y, x + getIndicatorSize(), y - getIndicatorSize(), x + getIndicatorSize(), y + getIndicatorSize());
214 }
215 if (getScrollLeft() < getMaxScrollLeft()) {
216 float x = getWidth() - getIndicatorMargin();
217 float y = getHeight() / 2;
218 g.fillTriangle(getIndicatorColor(), x, y, x - getIndicatorSize(), y - getIndicatorSize(), x - getIndicatorSize(), y + getIndicatorSize());
219 }
220 if (getScrollTop() > 0) {
221 float x = getWidth() / 2;
222 float y = getIndicatorMargin();
223 g.fillTriangle(getIndicatorColor(), x, y, x - getIndicatorSize(), y + getIndicatorSize(), x + getIndicatorSize(), y + getIndicatorSize());
224 }
225 if (getScrollTop() < getMaxScrollTop()) {
226 float x = getWidth() / 2;
227 float y = getHeight() - getIndicatorSize();
228 g.fillTriangle(getIndicatorColor(), x, y, x - getIndicatorSize(), y - getIndicatorSize(), x + getIndicatorSize(), y - getIndicatorSize());
229 }
230 } catch (Exception e) {
231 }
232 }
233 }
234
235 protected FDisplayObject getDropDownOwner() {
236 return menuTab;

Callers

nothing calls this directly

Calls 13

getBorderColorMethod · 0.95
getDropDownOwnerMethod · 0.95
drawRectMethod · 0.80
getScrollLeftMethod · 0.80
getIndicatorMarginMethod · 0.80
fillTriangleMethod · 0.80
getIndicatorColorMethod · 0.80
getIndicatorSizeMethod · 0.80
getMaxScrollLeftMethod · 0.80
getScrollTopMethod · 0.80
getMaxScrollTopMethod · 0.80
getWidthMethod · 0.65

Tested by

no test coverage detected