Skip to content

Commit

Permalink
ListIndexModel must emit items-changed when size changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwharm committed Jan 12, 2023
1 parent c71ce38 commit 8e5650a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ public ListIndexModel(int size) {
}

public void setSize(int size) {
int oldSize = getNItems();
getMemoryLayout()
.varHandle(MemoryLayout.PathElement.groupElement("size"))
.set(MemorySegment.ofAddress((MemoryAddress) handle(), getMemoryLayout().byteSize(), MemorySession.openImplicit()), size);
itemsChanged(0, oldSize, size);
}

@Override
Expand Down

0 comments on commit 8e5650a

Please sign in to comment.