Scoop API

scoop:scoop.ui.style:0.1.0

src/theme/logical_insets.scoop

Selected production source · src/theme/logical_insets.scoop

1package scoop.ui.style
3import scoop.ui.LayoutDirection
5public struct LogicalInsets(
6 val start: Double = 0.0,
7 val top: Double = 0.0,
8 val end: Double = 0.0,
9 val bottom: Double = 0.0
10) {
11 public companion object {
12 public fun all(value: Double): LogicalInsets = LogicalInsets(value, value, value, value)
13 }
14 public fun resolve(direction: LayoutDirection): Insets {
15 val result =
16 if (direction == LayoutDirection.Rtl)
17 Insets(end, top, start, bottom)
18 else
19 Insets(start, top, end, bottom)
20 result.totals()
21 return result
22 }