mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 15:37:01 +00:00
Change name to avoid confusion
This commit is contained in:
parent
aced3ac27c
commit
f0809b0aae
@ -487,9 +487,16 @@ final class StoryItemContentComponent: Component {
|
||||
}
|
||||
|
||||
if let dimensions {
|
||||
var imageSize = dimensions.aspectFilled(availableSize)
|
||||
if imageSize.width < availableSize.width && imageSize.width >= availableSize.width - 5.0 {
|
||||
imageSize.width = availableSize.width
|
||||
}
|
||||
if imageSize.height < availableSize.height && imageSize.height >= availableSize.height - 5.0 {
|
||||
imageSize.height = availableSize.height
|
||||
}
|
||||
let apply = self.imageNode.asyncLayout()(TransformImageArguments(
|
||||
corners: ImageCorners(),
|
||||
imageSize: dimensions.aspectFilled(availableSize),
|
||||
imageSize: imageSize,
|
||||
boundingSize: availableSize,
|
||||
intrinsicInsets: UIEdgeInsets()
|
||||
))
|
||||
|
@ -182,16 +182,16 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
}
|
||||
|
||||
struct ItemLayout {
|
||||
var size: CGSize
|
||||
var containerSize: CGSize
|
||||
var contentFrame: CGRect
|
||||
var contentVisualScale: CGFloat
|
||||
|
||||
init(
|
||||
size: CGSize,
|
||||
containerSize: CGSize,
|
||||
contentFrame: CGRect,
|
||||
contentVisualScale: CGFloat
|
||||
) {
|
||||
self.size = size
|
||||
self.containerSize = containerSize
|
||||
self.contentFrame = contentFrame
|
||||
self.contentVisualScale = contentVisualScale
|
||||
}
|
||||
@ -567,7 +567,7 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
let point = recognizer.location(in: self)
|
||||
|
||||
var direction: NavigationDirection?
|
||||
if point.x < itemLayout.size.width * 0.25 {
|
||||
if point.x < itemLayout.containerSize.width * 0.25 {
|
||||
direction = .previous
|
||||
} else {
|
||||
direction = .next
|
||||
@ -670,7 +670,7 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
}
|
||||
|
||||
self.scrollingCenterX = leftWidth
|
||||
self.scroller.contentSize = CGSize(width: leftWidth + itemLayout.size.width + rightWidth, height: 1.0)
|
||||
self.scroller.contentSize = CGSize(width: leftWidth + itemLayout.containerSize.width + rightWidth, height: 1.0)
|
||||
|
||||
if !self.initializedOffset {
|
||||
self.initializedOffset = true
|
||||
@ -862,7 +862,7 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
environment: {
|
||||
itemEnvironment
|
||||
},
|
||||
containerSize: itemLayout.size
|
||||
containerSize: itemLayout.contentFrame.size
|
||||
)
|
||||
if let view = visibleItem.view.view {
|
||||
if visibleItem.contentContainerView.superview == nil {
|
||||
@ -2048,7 +2048,7 @@ public final class StoryItemSetContainerComponent: Component {
|
||||
let contentFrame = CGRect(origin: CGPoint(x: 0.0, y: component.containerInsets.top - (contentSize.height - contentVisualHeight) * 0.5), size: contentSize)
|
||||
|
||||
let itemLayout = ItemLayout(
|
||||
size: contentFrame.size,
|
||||
containerSize: availableSize,
|
||||
contentFrame: contentFrame,
|
||||
contentVisualScale: contentVisualScale
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user