Skip to content

Commit

Permalink
Merge pull request #54 from swhitty/display-block
Browse files Browse the repository at this point in the history
Support display:block
  • Loading branch information
swhitty authored Nov 5, 2024
2 parents fb79a0a + 8a1a25c commit bf943ce
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Examples/Sources/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ViewController: UIViewController {

override func loadView() {
let imageView = UIImageView(frame: UIScreen.main.bounds)
imageView.image = SVG(named: "stars.svg", in: .samples)?.rasterize()
imageView.image = SVG(named: "bike.svg", in: .samples)?.rasterize()
imageView.contentMode = .scaleAspectFit
imageView.backgroundColor = .white
self.view = imageView
Expand Down
1 change: 1 addition & 0 deletions Samples.bundle/bike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions SwiftDraw/DOM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ extension DOM {
enum DisplayMode: String {
case none
case inline
case block
}

enum LineCap: String {
Expand Down
2 changes: 1 addition & 1 deletion SwiftDraw/LayerTree.Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension LayerTree {
let attributes = element.attributes
let l = Layer()
l.class = element.class
guard state.display == .inline else { return l }
guard state.display != .none else { return l }

l.transform = Builder.createTransforms(from: attributes.transform ?? [])
l.clip = createClipShapes(for: element)
Expand Down

0 comments on commit bf943ce

Please sign in to comment.