Skip to content

Commit 8ee94b5

Browse files
committed
Move DrawingContext Struct
1 parent 5c813dd commit 8ee94b5

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Sources/CodeEditSourceEditor/Gutter/LineFolding/FoldingRibbonView+Draw.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ import AppKit
99
import CodeEditTextView
1010

1111
extension FoldingRibbonView {
12+
/// The context in which the fold is being drawn, including the depth and fold range.
13+
struct FoldMarkerDrawingContext {
14+
let range: ClosedRange<Int>
15+
let depth: UInt
16+
17+
/// Increment the depth
18+
func incrementDepth() -> FoldMarkerDrawingContext {
19+
FoldMarkerDrawingContext(
20+
range: range,
21+
depth: depth + 1
22+
)
23+
}
24+
}
25+
1226
override func draw(_ dirtyRect: NSRect) {
1327
guard let context = NSGraphicsContext.current?.cgContext,
1428
let layoutManager = model.textView?.layoutManager else {

Sources/CodeEditSourceEditor/Gutter/LineFolding/FoldingRibbonView.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,4 @@ class FoldingRibbonView: NSView {
158158
hoverAnimationProgress = 0.0
159159
hoveringFold = nil
160160
}
161-
162-
/// The context in which the fold is being drawn, including the depth and fold range.
163-
struct FoldMarkerDrawingContext {
164-
let range: ClosedRange<Int>
165-
let depth: UInt
166-
167-
/// Increment the depth
168-
func incrementDepth() -> FoldMarkerDrawingContext {
169-
FoldMarkerDrawingContext(
170-
range: range,
171-
depth: depth + 1
172-
)
173-
}
174-
}
175161
}

0 commit comments

Comments
 (0)