static Pair<Shape, Rect> textLayoutToOutlineAndSize_multiLine(S text, Font font, Component c) { LS lines = lines(text); Area area = null; int y = 0, w = 0; for (S line : lines) { Pair<Shape, Rect> p = textLayoutToOutlineAndSize(line, font, c); w = max(w, p.b.w); Area a = new(p.a); new AffineTransform tx; tx.translate(0, y); area = areaUnion(area, a.createTransformedArea(tx)); y += p.b.h; } ret pair(area, rect(0, 0, w, y)); }
Began life as a copy of #1023068
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023069 |
Snippet name: | textLayoutToOutlineAndSize_multiLine |
Eternal ID of this version: | #1023069/3 |
Text MD5: | 4537cb70fa4172e28190572032913ba5 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-30 20:46:13 |
Source code size: | 482 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 280 / 316 |
Version history: | 2 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1023074 - textLayoutToOutlineAndSize_multiLine_centered |