From bec0cb1e75cb98022921ad6316dae43f8099aece Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 11 Jan 2019 16:47:20 +0530 Subject: [PATCH] macOS: Fix editor scrolling --- .../UI/macOS/ViewController/TunnelEditViewController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift index b818d9f..4edb17a 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift @@ -28,8 +28,9 @@ class TunnelEditViewController: NSViewController { let minHeight: CGFloat = 310 textView.minSize = NSSize(width: 0, height: minHeight) textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude) - textView.autoresizingMask = [.width, .height] - textView.isHorizontallyResizable = true + textView.autoresizingMask = [.width] // Width should be based on superview width + textView.isHorizontallyResizable = false // Width shouldn't be based on content + textView.isVerticallyResizable = true // Height should be based on content if let textContainer = textView.textContainer { textContainer.size = NSSize(width: minWidth, height: CGFloat.greatestFiniteMagnitude) textContainer.widthTracksTextView = true