Skip to content

Commit

Permalink
Remove unnecessary on_layout_changed call. Canvas size stream automat…
Browse files Browse the repository at this point in the history
…ically used.
  • Loading branch information
cmeyer committed Jul 21, 2023
1 parent c0a42ba commit 35534ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions nion/swift/MetadataPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ def __init__(self, document_controller: DocumentController.DocumentController, p

def content_size_changed(content_size: Geometry.IntSize) -> None:
def _content_height_changed() -> None:
# start = time.perf_counter_ns()

# the code below will do the upstream part of the line below. we can't use the line below
# because it will lay out the children again.
# metadata_editor_canvas_item.update_layout(Geometry.IntPoint(), content_size)
Expand All @@ -306,11 +304,6 @@ def _content_height_changed() -> None:

# set the content size and send it on up so the scroll area sees it.
metadata_editor_canvas_item._set_canvas_size(content_size)
if callable(metadata_editor_canvas_item.on_layout_updated):
metadata_editor_canvas_item.on_layout_updated(metadata_editor_canvas_item.canvas_origin, metadata_editor_canvas_item.canvas_size, False)

# end = time.perf_counter_ns()
# print(f"height change {(end - start) / 1000}us")
self.__thread_helper.call_on_main_thread("_content_height_changed", _content_height_changed)

metadata_editor_canvas_item = ThreadedCanvasItem(ui.get_font_metrics, delegate, content_size_changed)
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = nionswift
version = 0.16.8
# niondata >= 0.15.3 (DataMetadata read-only props), nionutils >= 0.4.7 (DatetimeToStringConverter/is_local)
# nionui >= 0.6.12 (layout)
author = Nion Software
author_email = swift@nion.com
description = Nion Swift: Scientific Image Processing.
Expand Down

0 comments on commit 35534ca

Please sign in to comment.