add test
This commit is contained in:
parent
eae3b5e443
commit
f852d33ada
4 changed files with 18 additions and 0 deletions
BIN
tests/fonts/diffs/selection_rects3.png
Normal file
BIN
tests/fonts/diffs/selection_rects3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 243 B |
BIN
tests/fonts/masters/selection_rects3.png
Normal file
BIN
tests/fonts/masters/selection_rects3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
tests/fonts/rendered/selection_rects3.png
Normal file
BIN
tests/fonts/rendered/selection_rects3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
|
@ -689,3 +689,21 @@ block:
|
||||||
image.fillRect(rect, rgba(128, 128, 128, 128))
|
image.fillRect(rect, rgba(128, 128, 128, 128))
|
||||||
|
|
||||||
doDiff(image, "selection_rects2")
|
doDiff(image, "selection_rects2")
|
||||||
|
|
||||||
|
block:
|
||||||
|
var font = readFont("tests/fonts/Roboto-Regular_1.ttf")
|
||||||
|
font.size = 16
|
||||||
|
|
||||||
|
let image = newImage(75, 75)
|
||||||
|
image.fill(rgba(255, 255, 255, 255))
|
||||||
|
|
||||||
|
let arrangement = typeset(
|
||||||
|
font, "Wrapping text to new line", bounds = image.wh
|
||||||
|
)
|
||||||
|
|
||||||
|
image.fillText(arrangement)
|
||||||
|
|
||||||
|
for i, rect in arrangement.selectionRects:
|
||||||
|
image.fillRect(rect, rgba(128, 128, 128, 128))
|
||||||
|
|
||||||
|
doDiff(image, "selection_rects3")
|
||||||
|
|
Loading…
Reference in a new issue