MCPcopy Create free account
hub / github.com/HumbleUI/JWM / paint

Method paint

examples/dashboard/java/Panel.java:23–41  ·  view source on GitHub ↗
(Canvas canvas, int x, int y, int width, int height, float scale)

Source from the content-addressed store, hash-verified

21 public void accept(Event e) {}
22
23 public void paint(Canvas canvas, int x, int y, int width, int height, float scale) {
24 int count = canvas.save();
25 canvas.translate(x, y);
26 canvas.clipRect(Rect.makeXYWH(0, 0, width, height));
27 if (drawBG) {
28 try (var paint = new Paint()) {
29 paint.setColor(0x20000000);
30 canvas.drawRRect(RRect.makeXYWH(0, 0, width, height, 4 * scale), paint);
31 }
32 }
33 paintImpl(canvas, width, height, scale);
34 canvas.restoreToCount(count);
35
36 lastWidth = width;
37 lastHeight = height;
38 lastX = x;
39 lastY = y;
40 lastScale = scale;
41 }
42
43 public boolean contains(int x, int y) {
44 return IRect.makeXYWH(lastX, lastY, lastWidth, lastHeight).contains(x, y);

Callers

nothing calls this directly

Calls 2

paintImplMethod · 0.95
makeXYWHMethod · 0.80

Tested by

no test coverage detected