Skip to content

Commit

Permalink
Removed STDecorationView
Browse files Browse the repository at this point in the history
STDecorationView was removed as it's no longer needed. The view was used for
custom rendering attributes, but has been cleaned up to simplify the text view
hierarchy.
  • Loading branch information
krzyzanowskim committed Jan 1, 2025
1 parent 2cb25fe commit 2826711
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
38 changes: 0 additions & 38 deletions Sources/STTextViewAppKit/Overlays/STDecorationView.swift

This file was deleted.

9 changes: 1 addition & 8 deletions Sources/STTextViewAppKit/STTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// |---(STLineHighlightView | SelectionHighlightView)
// |---contentView
// |---(STInsertionPointView | STTextLayoutFragmentView)
// |---decorationView
// |---gutterView
//
//
Expand Down Expand Up @@ -434,9 +433,6 @@ import AVFoundation
/// Selection highlight content view.
internal let selectionView: STSelectionView

/// Layout fragments decoration, custom rendering attributes
internal let decorationView: STDecorationView

internal var fragmentViewMap: NSMapTable<NSTextLayoutFragment, STTextLayoutFragmentView>
private var usageBoundsForTextContainerObserver: NSKeyValueObservation?

Expand Down Expand Up @@ -586,7 +582,6 @@ import AVFoundation

contentView = STContentView()
selectionView = STSelectionView()
decorationView = STDecorationView(textLayoutManager: textLayoutManager)

allowsUndo = true
_undoManager = CoalescingUndoManager()
Expand Down Expand Up @@ -625,7 +620,6 @@ import AVFoundation

addSubview(selectionView)
addSubview(contentView)
addSubview(decorationView)

do {
let recognizer = DragSelectedTextGestureRecognizer(target: self, action: #selector(_dragSelectedTextGestureRecognizer(gestureRecognizer:)))
Expand Down Expand Up @@ -760,7 +754,7 @@ import AVFoundation
// and ignore utility subviews that should remain transparent
// for interaction.
if let view = result, view != self,
(view.isDescendant(of: contentView) || view.isDescendant(of: selectionView) || view.isDescendant(of: decorationView))
(view.isDescendant(of: contentView) || view.isDescendant(of: selectionView))
{
return self
}
Expand Down Expand Up @@ -1211,7 +1205,6 @@ import AVFoundation
if !contentFrame.isAlmostEqual(to: contentView.frame) {
contentView.frame = contentFrame
selectionView.frame = contentFrame
decorationView.frame = contentFrame
}

_configureTextContainerSize()
Expand Down

0 comments on commit 2826711

Please sign in to comment.