File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Arcade [PyPi Release History](https://pypi.org/project/arcade/#history) page.
77
88- Fixed an issue causing a crash when closing the window
99- Added ` Window.close ` (bool) attribute indicating if the window is closed
10+ - GUI
11+ - Fix ` UILabel ` with enabled multiline sometimes cut off text
1012
1113## Version 3.2
1214
Original file line number Diff line number Diff line change @@ -126,8 +126,8 @@ def __init__(
126126 self ._strong_background = True
127127
128128 if adaptive_multiline :
129- # +1 is required to prevent line wrap
130- width = self ._label .content_width + 1
129+ # +1 is required to prevent line wrap, +1 is required to prevent issues with kerning
130+ width = self ._label .content_width + 2
131131
132132 super ().__init__ (
133133 x = x ,
@@ -242,7 +242,8 @@ def _update_label(self):
242242
243243 def _update_size_hint_min (self ):
244244 """Update the minimum size hint based on the label content size."""
245- min_width = self ._label .content_width + 1 # +1 required to prevent line wrap
245+ # +1 is required to prevent line wrap, +1 is required to prevent issues with kerning
246+ min_width = self ._label .content_width + 2
246247 min_width += self ._padding_left + self ._padding_right + 2 * self ._border_width
247248
248249 min_height = self ._label .content_height
Original file line number Diff line number Diff line change 11from unittest .mock import Mock
22
3- import pytest
43from pyglet .math import Vec2
54
65from arcade .gui import UILabel
@@ -192,7 +191,7 @@ def test_integration_with_layout_fit_to_content(ui):
192191 ui .execute_layout ()
193192
194193 # auto size should fit the text
195- assert label .rect .width == 44
194+ assert label .rect .width == 45
196195 assert label .rect .height == 12
197196
198197 # even when text changed
@@ -221,7 +220,7 @@ def test_fit_content_overrides_width(ui):
221220
222221 label .fit_content ()
223222
224- assert label .rect .width == 44
223+ assert label .rect .width == 45
225224 assert label .rect .height == 12
226225
227226
You can’t perform that action at this time.
0 commit comments