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

Method drawLine

examples/scenes/src/ParagraphStyleScene.java:16–26  ·  view source on GitHub ↗
(Canvas canvas, String text, ParagraphStyle ps, float width)

Source from the content-addressed store, hash-verified

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

Callers 1

drawStylesMethod · 0.95

Calls 6

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

Tested by

no test coverage detected