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

Method drawOverlay

forge-gui-mobile/src/forge/toolbox/FGroupBox.java:28–50  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

26 }
27
28 @Override
29 protected void drawOverlay(Graphics g) {
30 float w = getWidth();
31 float h = getHeight();
32 float x = 2 * PADDING;
33 float y = FONT.getCapHeight() / 2;
34
35 g.drawLine(BORDER_THICKNESS, getForeColor(), 0, y, 0, h); //draw left border
36 g.drawLine(BORDER_THICKNESS, getForeColor(), 0, h, w, h); //draw bottom border
37 g.drawLine(BORDER_THICKNESS, getForeColor(), w, h, w, y); //draw right border
38
39 //draw caption
40 g.drawText(caption, FONT, getForeColor(), x, 0, w - x - PADDING, h, false, Align.left, false);
41
42 //draw border left of caption
43 g.drawLine(BORDER_THICKNESS, getForeColor(), 0, y, x, y);
44
45 //draw border right of caption if needed
46 float captionEnd = x + FONT.getBounds(caption).width;
47 if (captionEnd < w) {
48 g.drawLine(BORDER_THICKNESS, getForeColor(), captionEnd, y, w, y);
49 }
50 }
51
52 @Override
53 protected void doLayout(float width, float height) {

Callers

nothing calls this directly

Calls 7

getForeColorMethod · 0.95
drawLineMethod · 0.80
getWidthMethod · 0.65
getHeightMethod · 0.65
getCapHeightMethod · 0.45
drawTextMethod · 0.45
getBoundsMethod · 0.45

Tested by

no test coverage detected