MCPcopy Create free account
hub / github.com/cinit/TMoe / draw

Method draw

app/src/main/java/cc/ioctl/tmoe/ui/Theme.java:385–406  ·  view source on GitHub ↗
(Canvas canvas)

Source from the content-addressed store, hash-verified

383 RectF rect;
384
385 @Override
386 public void draw(Canvas canvas) {
387 android.graphics.Rect bounds = getBounds();
388 if (maskType == 7) {
389 if (rect == null) {
390 rect = new RectF();
391 }
392 rect.set(bounds);
393 canvas.drawRoundRect(rect, LayoutHelper.dp(6), LayoutHelper.dp(6), sMaskPaint);
394 } else {
395 int rad;
396 if (maskType == 1 || maskType == 6) {
397 rad = LayoutHelper.dp(20);
398 } else if (maskType == 3) {
399 rad = (Math.max(bounds.width(), bounds.height()) / 2);
400 } else {
401 rad = (int) Math.ceil(Math.sqrt((bounds.left - bounds.centerX()) * (bounds.left - bounds.centerX())
402 + (bounds.top - bounds.centerY()) * (bounds.top - bounds.centerY())));
403 }
404 canvas.drawCircle(bounds.centerX(), bounds.centerY(), rad, sMaskPaint);
405 }
406 }
407
408 @Override
409 public void setAlpha(int alpha) {

Callers

nothing calls this directly

Calls 2

dpMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected