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:
parent
3c97be617a
commit
8e5ad7f67f
|
@ -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
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue