SwiftMath icon indicating copy to clipboard operation
SwiftMath copied to clipboard

View size when wrapped in SwiftUI view

Open marklambourne opened this issue 11 months ago • 2 comments

I'm using the provided code to wrap SwiftMath in a SwiftUI View. But the default size of that view seems to be infinity in both directions, regardless of the actual size of the content. That's quite different behaviour from most SwiftUI Views, including Text. Makes it difficult to use alongside other items as the layout gets broken. I would expect the default size of the view to be no more than the equation content plus the insets (if there are any). Any ideas? Thanks!

marklambourne avatar Feb 13 '25 08:02 marklambourne

Actually ignore that, sorry, sorted it out with .fixedSize() with reduces the frame down to the minimum required for the maths content.

marklambourne avatar Feb 13 '25 08:02 marklambourne