scoop:scoop.ui.component:0.1.0
src/builders/media.scoop
Selected production source · src/builders/media.scoop
1
package scoop.ui.component3
import scoop.graphics.*4
import scoop.ui.*6
public class ImageViewBuilder internal constructor() {7
public var fit: ContentFit = ContentFit.Contain8
public var alignment: Alignment = Alignment()9
public var clip: Boolean = true10
public var sampling: ImageSampling = ImageSampling.Linear11
public var opacity: Double = 1.012
public var key: ViewKey = ViewKey.Position13
public var semantics: ComponentSemantics? = None14
}16
public fun imageView(17
image: Image,18
naturalSize: Size,19
configure: ImageViewBuilder.() -> Unit = {}20
): View = makeImageView(image, naturalSize, configure)22
internal fun makeImageView(23
image: Image,24
naturalSize: Size,25
configure: ImageViewBuilder.() -> Unit26
): View {27
val builder = ImageViewBuilder()28
builder.configure()29
return element(30
ImageViewProps(31
image,32
naturalSize,33
builder.fit,34
builder.alignment,35
builder.clip,36
builder.sampling,37
builder.opacity,38
builder.semantics39
),40
{ props, mount -> ImageView(props, scope = mount) },41
key = builder.key42
)43
}45
public class PathViewBuilder internal constructor() {46
public var naturalSize: Size? = None47
public var paint: Paint = Paint()48
public var fit: ContentFit = ContentFit.Contain49
public var alignment: Alignment = Alignment()50
public var clip: Boolean = true51
public var key: ViewKey = ViewKey.Position52
public var semantics: ComponentSemantics? = None53
}55
public fun pathView(path: Path, viewBox: Rect, configure: PathViewBuilder.() -> Unit = {}): View =56
makePathView(path, viewBox, configure)58
internal fun makePathView(path: Path, viewBox: Rect, configure: PathViewBuilder.() -> Unit): View {59
val builder = PathViewBuilder()60
builder.configure()61
return element(62
PathViewProps(63
path,64
viewBox,65
builder.naturalSize,66
builder.paint,67
builder.fit,68
builder.alignment,69
builder.clip,70
builder.semantics71
),72
{ props, mount -> PathView(props, scope = mount) },73
key = builder.key74
)75
}