Skip to content

Commit

Permalink
Take into account annotation tool button spacing for layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak committed Aug 20, 2024
1 parent 842e867 commit efead14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ class AnnotationToolbarViewController: UIViewController {
if remainingSize < 0 {
DDLogWarn("AnnotationToolbarViewController: not enough \(isHorizontal ? "horizontal" : "vertical") minimum size")
}
let count = max(0, min(Int(floor(remainingSize / buttonSize)), toolButtons.count))
let buttonSpacing = stackView.spacing
let count = max(0, min(Int(floor((remainingSize + buttonSpacing) / (buttonSize + buttonSpacing))), toolButtons.count))

for idx in 0..<count {
guard idx < (count - 1) || count == toolButtons.count else { continue }
Expand Down

0 comments on commit efead14

Please sign in to comment.