mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -769,8 +769,14 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo
|
|||||||
if let reactionContextNode = self.reactionContextNode {
|
if let reactionContextNode = self.reactionContextNode {
|
||||||
additionalVisibleOffsetY += reactionContextNode.visibleExtensionDistance
|
additionalVisibleOffsetY += reactionContextNode.visibleExtensionDistance
|
||||||
}
|
}
|
||||||
if case .reference = self.source {
|
if case let .reference(source) = self.source {
|
||||||
if actionsFrame.maxY > layout.size.height {
|
var actionsFrameIsOutOfScreen = false
|
||||||
|
if let contentAreaInScreenSpace = source.transitionInfo()?.contentAreaInScreenSpace {
|
||||||
|
if !contentAreaInScreenSpace.contains(actionsFrame) {
|
||||||
|
actionsFrameIsOutOfScreen = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if actionsFrame.maxY > layout.size.height || actionsFrameIsOutOfScreen {
|
||||||
actionsFrame.origin.y = contentRect.minY - actionsSize.height - contentActionsSpacing
|
actionsFrame.origin.y = contentRect.minY - actionsSize.height - contentActionsSpacing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,6 @@ final class PenTool: DrawingElement {
|
|||||||
var renderArrowLineWidth: CGFloat
|
var renderArrowLineWidth: CGFloat
|
||||||
|
|
||||||
let isEraser: Bool
|
let isEraser: Bool
|
||||||
|
|
||||||
let isBlur: Bool
|
let isBlur: Bool
|
||||||
|
|
||||||
var arrowStart: CGPoint?
|
var arrowStart: CGPoint?
|
||||||
@@ -277,7 +276,12 @@ final class PenTool: DrawingElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bounds: CGRect {
|
var bounds: CGRect {
|
||||||
return normalizeDrawingRect(boundingRect(from: 0, to: self.segments.count).insetBy(dx: -20.0, dy: -20.0), drawingSize: self.drawingSize)
|
let segmentsBounds = boundingRect(from: 0, to: self.segments.count).insetBy(dx: -20.0, dy: -20.0)
|
||||||
|
var combinedBounds = segmentsBounds
|
||||||
|
if self.hasArrow, let arrowLeftPath, let arrowRightPath {
|
||||||
|
combinedBounds = combinedBounds.union(arrowLeftPath.bounds).union(arrowRightPath.bounds).insetBy(dx: -20.0, dy: -20.0)
|
||||||
|
}
|
||||||
|
return normalizeDrawingRect(combinedBounds, drawingSize: self.drawingSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
required init(drawingSize: CGSize, color: DrawingColor, lineWidth: CGFloat, hasArrow: Bool, isEraser: Bool, isBlur: Bool, blurredImage: UIImage?) {
|
required init(drawingSize: CGSize, color: DrawingColor, lineWidth: CGFloat, hasArrow: Bool, isEraser: Bool, isBlur: Bool, blurredImage: UIImage?) {
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ private final class ReferenceContentSource: ContextReferenceContentSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func transitionInfo() -> ContextControllerReferenceViewInfo? {
|
func transitionInfo() -> ContextControllerReferenceViewInfo? {
|
||||||
return ContextControllerReferenceViewInfo(referenceView: self.sourceView, contentAreaInScreenSpace: self.contentArea, customPosition: customPosition)
|
return ContextControllerReferenceViewInfo(referenceView: self.sourceView, contentAreaInScreenSpace: self.contentArea, customPosition: self.customPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -363,7 +363,9 @@
|
|||||||
_landscapeToolbarView.cancelPressed = toolbarCancelPressed;
|
_landscapeToolbarView.cancelPressed = toolbarCancelPressed;
|
||||||
_landscapeToolbarView.donePressed = toolbarDonePressed;
|
_landscapeToolbarView.donePressed = toolbarDonePressed;
|
||||||
_landscapeToolbarView.doneLongPressed = toolbarDoneLongPressed;
|
_landscapeToolbarView.doneLongPressed = toolbarDoneLongPressed;
|
||||||
[_wrapperView addSubview:_landscapeToolbarView];
|
|
||||||
|
if ([UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad)
|
||||||
|
[_wrapperView addSubview:_landscapeToolbarView];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user