Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 committed Nov 29, 2016
1 parent 00aef15 commit bd862bb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ViewController: UIViewController {
let document = Snowflake.Document(data: data)
else { return }

let svgView = document.svg.view(size: CGSize(width: 300, height: 200))
let svgView = document.svg.view(size: CGSize(width: 100, height: 100))
self.view.addSubview(svgView)
}

Expand Down
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ guard let path = Bundle.main.path(forResource: "xmas", ofType: "svg"),
let document = Snowflake.Document(data: data)
else { return }

let view = document.svg.view
let view = document.svg.view(size: CGSize(width: 100, height: 100))
```

<div align = "center">
Expand Down Expand Up @@ -123,7 +123,23 @@ let style = Style(attributes: attributes)

### Scale

- TBD
- Get bounding rectangle of the SVG shapes

```swift
let bounds = document.size.bounds()
```

- Scale layers to a given size

```swift
let layers = document.svg.layers(size: CGSize(width: 200, height: 100))
```

- Scale view to a given size

```swift
let view = document.svg.view(size: CGSize(width: 100, height: 100))
```

### Pattern

Expand Down

0 comments on commit bd862bb

Please sign in to comment.