-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework line higlight from drawing to layer
- Loading branch information
1 parent
b114a8d
commit 153665b
Showing
11 changed files
with
162 additions
and
147 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
Sources/STTextViewAppKit/Overlays/STLineHighlightView.swift
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,27 @@ | ||
// Created by Marcin Krzyzanowski | ||
// https://github.com/krzyzanowskim/STTextView/blob/main/LICENSE.md | ||
|
||
import AppKit | ||
|
||
final class STLineHighlightView: NSView { | ||
|
||
override init(frame frameRect: NSRect) { | ||
super.init(frame: frameRect) | ||
wantsLayer = true | ||
clipsToBounds = true | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
wantsLayer = true | ||
clipsToBounds = true | ||
} | ||
|
||
override var isFlipped: Bool { | ||
#if os(macOS) | ||
true | ||
#else | ||
false | ||
#endif | ||
} | ||
} |
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
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
Oops, something went wrong.