File tree 3 files changed +8
-6
lines changed 3 files changed +8
-6
lines changed 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.
7
7
8
8
- Fixed an issue causing a crash when closing the window
9
9
- Added ` Window.close ` (bool) attribute indicating if the window is closed
10
+ - GUI
11
+ - Fix ` UILabel ` with enabled multiline sometimes cut off text
10
12
11
13
## Version 3.2
12
14
Original file line number Diff line number Diff line change @@ -126,8 +126,8 @@ def __init__(
126
126
self ._strong_background = True
127
127
128
128
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
131
131
132
132
super ().__init__ (
133
133
x = x ,
@@ -242,7 +242,8 @@ def _update_label(self):
242
242
243
243
def _update_size_hint_min (self ):
244
244
"""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
246
247
min_width += self ._padding_left + self ._padding_right + 2 * self ._border_width
247
248
248
249
min_height = self ._label .content_height
Original file line number Diff line number Diff line change 1
1
from unittest .mock import Mock
2
2
3
- import pytest
4
3
from pyglet .math import Vec2
5
4
6
5
from arcade .gui import UILabel
@@ -192,7 +191,7 @@ def test_integration_with_layout_fit_to_content(ui):
192
191
ui .execute_layout ()
193
192
194
193
# auto size should fit the text
195
- assert label .rect .width == 44
194
+ assert label .rect .width == 45
196
195
assert label .rect .height == 12
197
196
198
197
# even when text changed
@@ -221,7 +220,7 @@ def test_fit_content_overrides_width(ui):
221
220
222
221
label .fit_content ()
223
222
224
- assert label .rect .width == 44
223
+ assert label .rect .width == 45
225
224
assert label .rect .height == 12
226
225
227
226
You can’t perform that action at this time.
0 commit comments