Skip to content

Commit 330e0ab

Browse files
committed
FIX: get layout metrics issue
1 parent 50417f6 commit 330e0ab

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

modules/view/backends/gtk3/text-box.reds

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,14 @@ OS-text-box-layout: func [
401401
]
402402
len: -1
403403
str: unicode/to-utf8 text :len
404-
pango_layout_set_width layout PANGO_SCALE * size/x
405-
pango_layout_set_height layout PANGO_SCALE * size/y
404+
if TYPE_OF(size) = TYPE_PAIR [
405+
if size/x <> 0 [
406+
pango_layout_set_width layout PANGO_SCALE * size/x
407+
]
408+
if size/y <> 0 [
409+
pango_layout_set_height layout PANGO_SCALE * size/y
410+
]
411+
]
406412
pango_layout_set_wrap layout PANGO_WRAP_WORD_CHAR ;-- TBD: apply para
407413
pango_layout_set_text layout str -1
408414

0 commit comments

Comments
 (0)