diff --git a/submodules/ComponentFlow/Source/Base/ChildComponentTransitions.swift b/submodules/ComponentFlow/Source/Base/ChildComponentTransitions.swift index 75752bea75..960121a751 100644 --- a/submodules/ComponentFlow/Source/Base/ChildComponentTransitions.swift +++ b/submodules/ComponentFlow/Source/Base/ChildComponentTransitions.swift @@ -88,12 +88,19 @@ public extension ComponentTransition.Update { transition.setPosition(view: view, position: position) transition.setScale(view: view, scale: scale) } else { - if component._anchorPoint != nil { - view.bounds = CGRect(origin: CGPoint(), size: size) + if view is UIScrollView { + let frame = component.size.centered(around: component._position ?? CGPoint()) + if view.frame != frame { + transition.setFrame(view: view, frame: frame) + } } else { - transition.setBounds(view: view, bounds: CGRect(origin: CGPoint(), size: size)) + if component._anchorPoint != nil { + view.bounds = CGRect(origin: CGPoint(), size: size) + } else { + transition.setBounds(view: view, bounds: CGRect(origin: CGPoint(), size: size)) + } + transition.setPosition(view: view, position: position) } - transition.setPosition(view: view, position: position) } let opacity = component._opacity ?? 1.0 if view.alpha != opacity { diff --git a/submodules/ComponentFlow/Source/Base/CombinedComponent.swift b/submodules/ComponentFlow/Source/Base/CombinedComponent.swift index 95ea2ebda7..5f019bc5ff 100644 --- a/submodules/ComponentFlow/Source/Base/CombinedComponent.swift +++ b/submodules/ComponentFlow/Source/Base/CombinedComponent.swift @@ -724,11 +724,15 @@ public extension CombinedComponent { updatedChild.view.center = updatedChild._position ?? CGPoint() updatedChild.view.transform = CGAffineTransform(scaleX: scale, y: scale) } else { - updatedChild.view.bounds = CGRect(origin: CGPoint(), size: updatedChild.size) - if updatedChild.view.layer.anchorPoint != CGPoint(x: 0.5, y: 0.5) { - updatedChild.view.layer.position = updatedChild._position ?? CGPoint() + if updatedChild.view is UIScrollView { + updatedChild.view.frame = updatedChild.size.centered(around: updatedChild._position ?? CGPoint()) } else { - updatedChild.view.center = updatedChild._position ?? CGPoint() + updatedChild.view.bounds = CGRect(origin: CGPoint(), size: updatedChild.size) + if updatedChild.view.layer.anchorPoint != CGPoint(x: 0.5, y: 0.5) { + updatedChild.view.layer.position = updatedChild._position ?? CGPoint() + } else { + updatedChild.view.center = updatedChild._position ?? CGPoint() + } } } diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/BUILD b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/BUILD index 07d4ac7084..7355c6c637 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/BUILD +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/BUILD @@ -49,7 +49,7 @@ swift_library( copts = [ "-warnings-as-errors", ], - data = [ + data = [ ":StoryPeerListBundle", ], deps = [