Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame sizes do not match expected behavior. #387

Closed
Joannis opened this issue Mar 7, 2021 · 0 comments · Fixed by #420
Closed

Frame sizes do not match expected behavior. #387

Joannis opened this issue Mar 7, 2021 · 0 comments · Fixed by #420
Assignees
Labels
bug Something isn't working

Comments

@Joannis
Copy link
Contributor

Joannis commented Mar 7, 2021

Describe the bug
Defining a full width or -height view does not match expectations, unless you set the minWidth or minHeight explicitly to 0.

To Reproduce
The following code fails

WindowGroup("Tokamak App") {
    Color.black.frame(
        maxWidth: .infinity,
        maxHeight: .infinity
    )
}

Expected behavior
The entire view is black.

Screenshots
The view is only black in a strip in the center.

image

Desktop:

  • OS: macOS
  • Browser Safari
  • Version of the browser 14.0.3 (16610.4.3.1.4)
  • Version of Tokamak 0.6.1

Additional context
It's simply fixed by modifying the fillWidth and fillHeight checks from minWidth == 0 to minWidth ?? 0 == 0. I'd also suggest a similar change be made when no frame is set, to implicitly make the view infinite width/height, unless there's an exception such as Text or TextField which are bound by font size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants