Fix selecting poll option playing too much haptic feedback

This commit is contained in:
Shadowfacts 2024-07-06 10:19:09 -07:00
parent 3eceffbb6b
commit c367a2e9f1
1 changed files with 2 additions and 1 deletions

View File

@ -153,7 +153,8 @@ class PollOptionsView: UIControl {
let location = touch.location(in: self)
var newIndex: Int? = nil
for (index, view) in options.enumerated() {
var frame = view.frame
// don't use view.frame because it changes when a transform is applied
var frame = CGRect(x: 0, y: view.center.y - view.bounds.height / 2, width: view.bounds.width, height: view.bounds.height)
if index != options.count - 1 {
frame = frame.inset(by: UIEdgeInsets(top: 0, left: 0, bottom: -stack.spacing, right: 0))
}