MCPcopy Create free account
hub / github.com/HumbleUI/Skija / drawLine

Method drawLine

examples/scenes/src/TextStyleScene.java:17–29  ·  view source on GitHub ↗
(Canvas canvas, String text, TextStyle ts)

Source from the content-addressed store, hash-verified

15 }
16
17 public void drawLine(Canvas canvas, String text, TextStyle ts) {
18 try (ParagraphStyle ps = new ParagraphStyle();
19 ParagraphBuilder pb = new ParagraphBuilder(ps, fc);)
20 {
21 pb.pushStyle(ts);
22 pb.addText(text);
23 try (Paragraph p = pb.build();) {
24 p.layout(Float.POSITIVE_INFINITY);
25 p.paint(canvas, 0, 0);
26 canvas.translate(0, p.getHeight() + 5);
27 }
28 }
29 }
30
31 @Override
32 public void draw(Canvas canvas, int width, int height, float dpi, int xpos, int ypos) {

Callers 1

drawMethod · 0.95

Calls 7

pushStyleMethod · 0.80
addTextMethod · 0.80
layoutMethod · 0.80
getHeightMethod · 0.65
buildMethod · 0.45
paintMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected