finestructure / Gala

Create SwiftUI preview variants for macOS, iOS, tvOS, and watchOS with ease
MIT License
87 stars 4 forks source link

Fix overlay #4

Closed finestructure closed 4 years ago

finestructure commented 4 years ago

Recent introduction of the background overlay (ZStack) has broken nesting, I believe:

// Playground generated with 🏟 Arena (https://github.com/finestructure/arena)
// ℹī¸ If running the playground fails with an error "no such module ..."
//    go to Product -> Build to re-trigger building the SPM package.
// ℹī¸ Please restart Xcode if autocomplete is not working.

import Gala
import PlaygroundSupport
import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Text("🎭 Gala").font(.title).padding()
            Text("🎭 Foo").font(.title).padding()
        }
    }
}

struct Preview: PreviewProvider {
    static var previews: some View {
        NightAndDay {
            Layouts([.sizeThatFits, .fixed(width: 200, height: 200)]) {
                ContentView()
            }
        }
    }
}

PlaygroundPage.current.setLiveView(Preview.previews)
Screenshot 2020-04-07 at 07 55 08

This should be showing four tiles and I believe it isn't, because they're overlaid.

finestructure commented 4 years ago

This might be fixed by #7 as well

finestructure commented 4 years ago

Indeed it is fixed in 0.3.2:

Screenshot 2020-05-23 at 10 04 56