Skip to content

Commit

Permalink
#2: Update Line Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
broadwaylamb committed Oct 21, 2016
1 parent a921af5 commit 36a9bff
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Demo/LineDemo.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ page.draw { context in
drawLine(in: context, x: 60, y: 680,
label: "pattern == [3], phase == 1: 2 on, 3 off, 3 on...")

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

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

let fillStrokeRectangle = constructRect(in: context, x: 300, y: 670, label: "Fill and Stroke")
context.fill(fillStrokeRectangle, stroke: true)
}

// Clip Rectangle
page.draw { context in

context.lineWidth = 2
context.strokeColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
context.fillColor = #colorLiteral(red: 0.7529411765, green: 0, blue: 0, alpha: 1)

let clipRectangle = constructRect(in: context, x: 300, y: 620, label: "Clip Rectangle")
context.stroke(clipRectangle)

context.fontSize = 13
context.textLeading = 12
context.show(text: "Clip Clip Clip Clip Clip Clipi Clip Clip Clip\n" +
"Clip Clip Clip Clip Clip Clipi Clip Clip Clip\n" +
"Clip Clip Clip Clip Clip Clipi Clip Clip Clip",
atX: 290, y: 600)
}

page.draw { context in
Expand Down

0 comments on commit 36a9bff

Please sign in to comment.