Adjusted visibility actions work for video start

commit_hash:4c560ff792489455c3f5da2cbde80b4781dc3b80
This commit is contained in:
denlvovich
2024-11-21 13:59:39 +03:00
parent a7f5643ee9
commit b058a7d5ff
2 changed files with 7 additions and 1 deletions
@@ -447,6 +447,7 @@ private final class DecoratingView: UIControl, BlockViewProtocol, VisibleBoundsT
passVisibleBoundsChanged(from: from, to: to)
if model.visibilityParams != nil {
if from == .zero, to == .zero { return }
visibilityActionPerformers?.onVisibleBoundsChanged(to: to, bounds: bounds)
}
}
@@ -498,7 +499,7 @@ extension DecoratingView {
case let .actions(actions):
actions.forEach { $0.perform(sendingFrom: self) }
case .contextMenu:
break;
break
}
}
}
@@ -39,6 +39,11 @@ final class VisibilityActionPerformers {
} else {
min(Int(to.area * 100 / bounds.area), 100)
}
guard visibleAreaPercentageAfter != visibleAreaPercentageBefore else {
return
}
visibilityParams.lastVisibleArea.value = visibleAreaPercentageAfter
for performer in actionPerformers {