-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Text wrapping, selection artifact suppression
- Loading branch information
1 parent
f878527
commit 51d0924
Showing
5 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// NSTextView+Workarounds.swift | ||
// TextViewPlus | ||
// | ||
// Created by Matt Massicotte on 2020-04-20. | ||
// Copyright © 2020 ChimeHq. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
extension NSTextView { | ||
|
||
/// Fixes selection drawing artifact issues. | ||
/// | ||
/// In many circumstances, NSTextView will perform incorrect drawing of selection. This | ||
/// will result in visual artifacts left over on the text background. This problem is | ||
/// visible in most applications that use NSTextView, including ones shipped by Apple. | ||
/// | ||
/// After some trial and error, it was determined that performing this operation will | ||
/// eliminate the visual artifacts and have limited (or possibly no) performance impact. | ||
public func applySelectionDrawingWorkaround() { | ||
rotate(byDegrees: 1.0) | ||
rotate(byDegrees: -1.0) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters