mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +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 {
|
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(
|
let apply = self.imageNode.asyncLayout()(TransformImageArguments(
|
||||||
corners: ImageCorners(),
|
corners: ImageCorners(),
|
||||||
imageSize: dimensions.aspectFilled(availableSize),
|
imageSize: imageSize,
|
||||||
boundingSize: availableSize,
|
boundingSize: availableSize,
|
||||||
intrinsicInsets: UIEdgeInsets()
|
intrinsicInsets: UIEdgeInsets()
|
||||||
))
|
))
|
||||||
|
@ -182,16 +182,16 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ItemLayout {
|
struct ItemLayout {
|
||||||
var size: CGSize
|
var containerSize: CGSize
|
||||||
var contentFrame: CGRect
|
var contentFrame: CGRect
|
||||||
var contentVisualScale: CGFloat
|
var contentVisualScale: CGFloat
|
||||||
|
|
||||||
init(
|
init(
|
||||||
size: CGSize,
|
containerSize: CGSize,
|
||||||
contentFrame: CGRect,
|
contentFrame: CGRect,
|
||||||
contentVisualScale: CGFloat
|
contentVisualScale: CGFloat
|
||||||
) {
|
) {
|
||||||
self.size = size
|
self.containerSize = containerSize
|
||||||
self.contentFrame = contentFrame
|
self.contentFrame = contentFrame
|
||||||
self.contentVisualScale = contentVisualScale
|
self.contentVisualScale = contentVisualScale
|
||||||
}
|
}
|
||||||
@ -567,7 +567,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
let point = recognizer.location(in: self)
|
let point = recognizer.location(in: self)
|
||||||
|
|
||||||
var direction: NavigationDirection?
|
var direction: NavigationDirection?
|
||||||
if point.x < itemLayout.size.width * 0.25 {
|
if point.x < itemLayout.containerSize.width * 0.25 {
|
||||||
direction = .previous
|
direction = .previous
|
||||||
} else {
|
} else {
|
||||||
direction = .next
|
direction = .next
|
||||||
@ -670,7 +670,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.scrollingCenterX = leftWidth
|
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 {
|
if !self.initializedOffset {
|
||||||
self.initializedOffset = true
|
self.initializedOffset = true
|
||||||
@ -862,7 +862,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
environment: {
|
environment: {
|
||||||
itemEnvironment
|
itemEnvironment
|
||||||
},
|
},
|
||||||
containerSize: itemLayout.size
|
containerSize: itemLayout.contentFrame.size
|
||||||
)
|
)
|
||||||
if let view = visibleItem.view.view {
|
if let view = visibleItem.view.view {
|
||||||
if visibleItem.contentContainerView.superview == nil {
|
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 contentFrame = CGRect(origin: CGPoint(x: 0.0, y: component.containerInsets.top - (contentSize.height - contentVisualHeight) * 0.5), size: contentSize)
|
||||||
|
|
||||||
let itemLayout = ItemLayout(
|
let itemLayout = ItemLayout(
|
||||||
size: contentFrame.size,
|
containerSize: availableSize,
|
||||||
contentFrame: contentFrame,
|
contentFrame: contentFrame,
|
||||||
contentVisualScale: contentVisualScale
|
contentVisualScale: contentVisualScale
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user