MCPcopy Create free account
hub / github.com/JetBrains/skija / drawLine

Method drawLine

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

Source from the content-addressed store, hash-verified

14 }
15
16 public void drawLine(Canvas canvas, String text, TextStyle ts) {
17 try (ParagraphStyle ps = new ParagraphStyle();
18 ParagraphBuilder pb = new ParagraphBuilder(ps, fc);)
19 {
20 pb.pushStyle(ts);
21 pb.addText(text);
22 try (Paragraph p = pb.build();) {
23 p.layout(Float.POSITIVE_INFINITY);
24 p.paint(canvas, 0, 0);
25 canvas.translate(0, p.getHeight() + 5);
26 }
27 }
28 }
29
30 @Override
31 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