Skip to content

Commit 36a9bff

Browse files
committed
#2: Update Line Demo
1 parent a921af5 commit 36a9bff

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Demo/LineDemo.playground/Contents.swift

+17-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ page.draw { context in
6868
drawLine(in: context, x: 60, y: 680,
6969
label: "pattern == [3], phase == 1: 2 on, 3 off, 3 on...")
7070

71-
context.dashStyle = DashStyle(pattern: [3, 7], phase: 2)!
71+
context.dashStyle = DashStyle(pattern: [7, 3], phase: 2)!
7272
drawLine(in: context, x: 60, y: 650,
73-
label: "pattern == [7, 3], phase == 2: 5 on 3 off, 7 on,...")
73+
label: "pattern == [7, 3], phase == 2: 5 on, 3 off, 7 on,...")
7474

7575
context.dashStyle = DashStyle(pattern: [8, 7, 2, 7])!
7676
drawLine(in: context, x: 60, y: 620,
@@ -144,9 +144,24 @@ page.draw { context in
144144

145145
let fillStrokeRectangle = constructRect(in: context, x: 300, y: 670, label: "Fill and Stroke")
146146
context.fill(fillStrokeRectangle, stroke: true)
147+
}
148+
149+
// Clip Rectangle
150+
page.draw { context in
151+
152+
context.lineWidth = 2
153+
context.strokeColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
154+
context.fillColor = #colorLiteral(red: 0.7529411765, green: 0, blue: 0, alpha: 1)
147155

148156
let clipRectangle = constructRect(in: context, x: 300, y: 620, label: "Clip Rectangle")
149157
context.stroke(clipRectangle)
158+
159+
context.fontSize = 13
160+
context.textLeading = 12
161+
context.show(text: "Clip Clip Clip Clip Clip Clipi Clip Clip Clip\n" +
162+
"Clip Clip Clip Clip Clip Clipi Clip Clip Clip\n" +
163+
"Clip Clip Clip Clip Clip Clipi Clip Clip Clip",
164+
atX: 290, y: 600)
150165
}
151166

152167
page.draw { context in

0 commit comments

Comments
 (0)