Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
You can grab pre-release versions from PyPi. See the available versions from the
Arcade [PyPi Release History](https://pypi.org/project/arcade/#history) page.

## Unreleased

- GUI
- Fix a bug, where the caret of UIInputText was misplaced after resizing the widget

## 3.3.2

- GUI
Expand Down
3 changes: 3 additions & 0 deletions arcade/gui/widgets/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,9 @@ def _update_layout(self):
layout.y = 0
layout.end_update()

# manually update caret position
self.caret.on_layout_update()

@property
def text(self):
"""Text of the input field."""
Expand Down
38 changes: 20 additions & 18 deletions tests/unit/gui/test_widget_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,25 @@ def objs_in_memory(obj_type):
del root
gc.collect()

if objs_in_memory(UIWidget) > start_count:
print("Render object graph...")
import objgraph

objgraph.show_chain(
objgraph.find_backref_chain(
[obj for obj in gc.get_objects() if isinstance(obj, UIWidget)][1],
objgraph.is_proper_module,
),
# filename="chain.png",
)

# print("Render backrefs...")
# objgraph.show_backrefs(
# [[obj for obj in gc.get_objects() if isinstance(obj, UIWidget)][1]],
# max_depth=15,
# # filename="sample-graph.png",
# )
# This might help, if the test fails ;)
# requires `objgraph`
# if objs_in_memory(UIWidget) > start_count:
# print("Render object graph...")
# import objgraph
#
# objgraph.show_chain(
# objgraph.find_backref_chain(
# [obj for obj in gc.get_objects() if isinstance(obj, UIWidget)][1],
# objgraph.is_proper_module,
# ),
# # filename="chain.png",
# )

# print("Render backrefs...")
# objgraph.show_backrefs(
# [[obj for obj in gc.get_objects() if isinstance(obj, UIWidget)][1]],
# max_depth=15,
# # filename="sample-graph.png",
# )

assert objs_in_memory(UIWidget) == start_count
Loading