Skip to content

Commit

Permalink
Update ViewDebug (#180)
Browse files Browse the repository at this point in the history
* Update EnvironmentHelper

* Update View documentation

* Fix animationsDisabled

* Update ViewDebug

* Update ViewDebug serialize data
  • Loading branch information
Kyle-Ye authored Dec 29, 2024
1 parent bbf40ef commit 0ae679f
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 173 deletions.
2 changes: 1 addition & 1 deletion Sources/OpenSwiftUI/App/AppGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package final class AppGraph: GraphHost {
}

private lazy var launchProfileOptions = LaunchProfileOptions(
rawValue: EnvironmentHelper.int32(for: "OPENSWIFTUI_PROFILE_LAUNCH")
rawValue: EnvironmentHelper.int32(for: "OPENSWIFTUI_PROFILE_LAUNCH") ?? 0
)

var didCollectLaunchProfile: Bool = false
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenSwiftUICore/Graph/GraphInputs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public struct _GraphInputs {

package var animationsDisabled: Bool {
get { options.contains(.animationsDisabled) }
set { options.formUnion(.animationsDisabled) }
set { options.setValue(newValue, for: .animationsDisabled) }
}

package var needsStableDisplayListIDs: Bool {
Expand Down
4 changes: 2 additions & 2 deletions Sources/OpenSwiftUICore/Util/EnvironmentHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import WASILibc

package enum EnvironmentHelper {
@_transparent
package static func int32(for key: String) -> Int32 {
package static func int32(for key: String) -> Int32? {
key.withCString { string in
guard let env = getenv(string) else {
return 0
return nil
}
return atoi(env)
}
Expand Down
Loading

0 comments on commit 0ae679f

Please sign in to comment.