OneScript

clipped

Clip drawing to a view's frame.

frame() preserves SwiftUI overflow behavior. Add clipped() after it to clip drawing to the frame boundary.

import { Image, Modifier } from "onescript/views"

const photoURL = new URL("https://example.com/photo.png")

<Image
  url={photoURL}
  resizable
  modifier={Modifier
    .scaledToFill()
    .frame({ width: 160, height: 90 })
    .clipped()}
/>

How is this guide?

Last updated on