Remove extra `path` element (#341)

The blue capsule in the PathDemo, rendered to HTML:

```diff
 <svg style="width: 100%;height: 100%; overflow: visible;">
   <rect
     x="0.0"
     height="100%"
     width="100%"
     y="0.0"
     ry="50%"
     stroke-width="0.0"
   ></rect>
-  <path style="stroke-width: 0.0;" d=""></path>
 </svg>
```

* Run swiftformat

* Remove excess `path` element
This commit is contained in:
Jed Fox 2020-12-22 18:03:00 -05:00 committed by GitHub
parent 3c97be617a
commit 8e5ad7f67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 10 deletions

View File

@ -132,6 +132,7 @@ public typealias AnyView = TokamakCore.AnyView
public typealias EmptyView = TokamakCore.EmptyView public typealias EmptyView = TokamakCore.EmptyView
// MARK: Text // MARK: Text
public typealias TextAlignment = TokamakCore.TextAlignment public typealias TextAlignment = TokamakCore.TextAlignment
// MARK: App & Scene // MARK: App & Scene

View File

@ -95,6 +95,7 @@ extension Path: ViewDeferredToRenderer {
elements: [Element], elements: [Element],
strokeStyle: StrokeStyle = .zero strokeStyle: StrokeStyle = .zero
) -> AnyView { ) -> AnyView {
if elements.isEmpty { return AnyView(EmptyView()) }
var d = [String]() var d = [String]()
for element in elements { for element in elements {
switch element { switch element {