diff --git a/SignalUI/Views/ImageEditor/ImageEditorCanvasView.swift b/SignalUI/Views/ImageEditor/ImageEditorCanvasView.swift index ffbf499878..5fcf68872b 100644 --- a/SignalUI/Views/ImageEditor/ImageEditorCanvasView.swift +++ b/SignalUI/Views/ImageEditor/ImageEditorCanvasView.swift @@ -799,12 +799,7 @@ class ImageEditorCanvasView: AttachmentPrepContentView { // * Model transform (so that text doesn't become blurry as you zoom the content). layer.contentsScale = UIScreen.main.scale * item.scaling * transform.scaling - // TODO: Min with measured width. - let maxWidth = imageFrame.size.width * item.unitWidth - - let maxSize = CGSize(width: maxWidth, height: CGFloat.greatestFiniteMagnitude) - // TODO: Is there a more accurate way to measure text in a CATextLayer? - // CoreText? + let maxSize = CGSize(width: imageFrame.size.width * item.unitWidth, height: CGFloat.greatestFiniteMagnitude) let textBounds = attributedString.boundingRect(with: maxSize, options: [ .usesLineFragmentOrigin, .usesFontLeading ], context: nil) diff --git a/SignalUI/Views/ImageEditor/ImageEditorViewController+Text.swift b/SignalUI/Views/ImageEditor/ImageEditorViewController+Text.swift index 925c7e082c..580cafe49c 100644 --- a/SignalUI/Views/ImageEditor/ImageEditorViewController+Text.swift +++ b/SignalUI/Views/ImageEditor/ImageEditorViewController+Text.swift @@ -52,8 +52,8 @@ extension ImageEditorViewController { textContainerBackground.autoPinEdge(toSuperviewEdge: .bottom, withInset: -300) textViewContainer.addSubview(textView) - textView.autoCenterInSuperview() - textView.autoPinWidthToSuperviewMargins(relation: .lessThanOrEqual) + textView.autoVCenterInSuperview() + textView.autoPinWidthToSuperviewMargins() textView.autoPinHeightToSuperviewMargins(relation: .lessThanOrEqual) textView.widthAnchor.constraint(greaterThanOrEqualToConstant: 40).isActive = true