diff --git a/submodules/DrawingUI/Sources/DrawingLocationEntity.swift b/submodules/DrawingUI/Sources/DrawingLocationEntity.swift index 6f57c7b5bd..ba245c6303 100644 --- a/submodules/DrawingUI/Sources/DrawingLocationEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingLocationEntity.swift @@ -264,7 +264,7 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg self.iconView.image = generateIcon(style: self.locationEntity.style) } - self.backgroundView.layer.cornerRadius = self.textSize.height * 0.18 + self.backgroundView.layer.cornerRadius = self.textSize.height * 0.2 self.blurredBackgroundView.layer.cornerRadius = self.backgroundView.layer.cornerRadius if #available(iOS 13.0, *) { self.backgroundView.layer.cornerCurve = .continuous diff --git a/submodules/DrawingUI/Sources/DrawingTextEntity.swift b/submodules/DrawingUI/Sources/DrawingTextEntity.swift index a4be3b3d72..f3a5d2d8a5 100644 --- a/submodules/DrawingUI/Sources/DrawingTextEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingTextEntity.swift @@ -1067,7 +1067,7 @@ final class DrawingTextLayoutManager: NSLayoutManager { var last = self.rectArray[index - 1] var cur = self.rectArray[index] - self.radius = cur.height * 0.18 + self.radius = cur.height * 0.2 let doubleRadius = self.radius * 2.5 @@ -1134,7 +1134,7 @@ final class DrawingTextLayoutManager: NSLayoutManager { var last: CGRect = .null for i in 0 ..< self.rectArray.count { let cur = self.rectArray[i] - self.radius = cur.height * 0.18 + self.radius = cur.height * 0.2 path.append(UIBezierPath(roundedRect: cur, cornerRadius: self.radius)) if i == 0 { diff --git a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift index a405045440..47a8545da5 100644 --- a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift @@ -1069,7 +1069,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM let actionsInset: CGFloat = 148.0 let padding: CGFloat = 16.0 let emptyTextSize = self.emptyResultsTextNode.updateLayout(CGSize(width: layout.size.width - layout.safeInsets.left - layout.safeInsets.right - padding * 2.0, height: CGFloat.greatestFiniteMagnitude)) - transition.updateFrame(node: self.emptyResultsTextNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - emptyTextSize.width) / 2.0), y: headerHeight + actionsInset + floor((layout.size.height - headerHeight - actionsInset - emptyTextSize.height - layout.intrinsicInsets.bottom) / 2.0)), size: emptyTextSize)) + transition.updateFrame(node: self.emptyResultsTextNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - emptyTextSize.width) / 2.0), y: headerHeight + actionsInset + floor((layout.size.height - headerHeight - actionsInset - emptyTextSize.height - layout.intrinsicInsets.bottom - layout.additionalInsets.bottom) / 2.0)), size: emptyTextSize)) } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationHeight: CGFloat, transition: ContainedViewLayoutTransition) { diff --git a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift index 5a584363e2..897a427dec 100644 --- a/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift +++ b/submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift @@ -186,6 +186,9 @@ final class MediaEditorScreenComponent: Component { var playerStateDisposable: Disposable? var playerState: MediaEditorPlayerState? + var isPremium = false + var isPremiumDisposable: Disposable? + init(context: AccountContext, mediaEditor: Signal) { self.context = context @@ -205,10 +208,19 @@ final class MediaEditorScreenComponent: Component { self.updated() } }) + + self.isPremiumDisposable = (context.engine.data.subscribe(TelegramEngine.EngineData.Item.Peer.Peer(id: context.account.peerId)) + |> deliverOnMainQueue).start(next: { [weak self] peer in + if let self { + self.isPremium = peer?.isPremium ?? false + self.updated() + } + }) } deinit { self.playerStateDisposable?.dispose() + self.isPremiumDisposable?.dispose() } var muteDidChange = false @@ -1195,7 +1207,7 @@ final class MediaEditorScreenComponent: Component { timeoutSelected: timeoutSelected, displayGradient: false, bottomInset: 0.0, - isFormattingLocked: false, + isFormattingLocked: !state.isPremium, hideKeyboard: self.currentInputMode == .emoji, forceIsEditing: self.currentInputMode == .emoji, disabledPlaceholder: nil @@ -2742,8 +2754,12 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate } var location: CLLocationCoordinate2D? - if let subject = self.subject, case let .asset(asset) = subject { - location = asset.location?.coordinate + if let subject = self.subject { + if case let .asset(asset) = subject { + location = asset.location?.coordinate + } else if case let .draft(draft, _) = subject { + location = draft.location + } } let locationController = storyLocationPickerController(context: self.context, location: location, completion: { [weak self] location, queryId, resultId, address, countryCode in if let self {