Skip to content

Commit

Permalink
Fix widget wizard rect bug (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored Sep 29, 2023
1 parent f643b13 commit 238dac3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ class OrderedWidgetCollection: FiniteWidgetCollection {
}

override func addTo(_ widget: LayoutWidget) {
items.insert(widget, at: predictedDropIndex!)
itemsWithPlaceholder = items
if let index = predictedDropIndex {
items.insert(widget, at: index)
itemsWithPlaceholder = items
}
}

func updatePlaceholderPosition(widgetDragging: LayoutWidget, index: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct LayoutWidgetEditView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.onAppear {
barCollection.rect = geo.frame(in: .global)
.offsetBy(dx: 0, dy: -outerFrame.origin.y)
.offsetBy(dx: -outerFrame.origin.x, dy: -outerFrame.origin.y)
.insetBy(dx: -20, dy: -60)
}
}
Expand Down Expand Up @@ -186,8 +186,9 @@ struct LayoutWidgetEditView: View {
Color.clear
.frame(maxWidth: .infinity, maxHeight: .infinity)
.onAppear {

trayCollection.rect = geo.frame(in: .global)
.offsetBy(dx: 0, dy: -outerFrame.origin.y - 90)
.offsetBy(dx: -outerFrame.origin.x, dy: -outerFrame.origin.y - 90)
}
}
}
Expand Down

0 comments on commit 238dac3

Please sign in to comment.