Skip to content

Commit 532ee89

Browse files
committed
Fix text container size debug logging
Add a debug log statement with the dimensions of the text container size when it's updated to help troubleshoot layout issues. Also rename a variable for clarity.
1 parent 6b1ee11 commit 532ee89

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Sources/STTextViewUIKit/STTextView.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -674,17 +674,18 @@ import STTextViewCommon
674674
// Update textContainer width to match textview width if track textview width
675675
// widthTracksTextView = true
676676
private func _configureTextContainerSize() {
677-
var containerSize = textContainer.size
677+
var proposedSize = textContainer.size
678678
if !isHorizontallyResizable {
679-
containerSize.width = contentSize.width // - _textContainerInset.width * 2
679+
proposedSize.width = contentSize.width // - _textContainerInset.width * 2
680680
}
681681

682682
if !isVerticallyResizable {
683-
containerSize.height = contentSize.height // - _textContainerInset.height * 2
683+
proposedSize.height = contentSize.height // - _textContainerInset.height * 2
684684
}
685685

686-
if !textContainer.size.isAlmostEqual(to: containerSize) {
687-
textContainer.size = containerSize
686+
if !textContainer.size.isAlmostEqual(to: proposedSize) {
687+
textContainer.size = proposedSize
688+
logger.debug("textContainer.size (\(self.textContainer.size.width), \(self.textContainer.size.width)) \(#function)")
688689
}
689690
}
690691

0 commit comments

Comments
 (0)