CanvasState

abstract class CanvasState<T : Any>(val viewConfig: ViewConfig<T>)

A state holder for current canvas size and view point. Allows transformation from coordinates to pixels and back

Constructors

Link copied to clipboard
constructor(viewConfig: ViewConfig<T>)

Properties

Link copied to clipboard
var canvasSize: DpSize
Link copied to clipboard
var selectRect: DpRect?
Link copied to clipboard
abstract val space: CoordinateSpace<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val zoom: Float

Functions

Link copied to clipboard
abstract fun computeViewPoint(rectangle: Rectangle<T>): ViewPoint<T>
Link copied to clipboard
abstract fun ViewPoint<T>.moveBy(x: Dp, y: Dp): ViewPoint<T>
Link copied to clipboard
abstract fun DpOffset.toCoordinates(): T
fun toCoordinates(offset: Offset, density: Density): T
Link copied to clipboard
abstract fun T.toDpOffset(): DpOffset
Link copied to clipboard
abstract fun Rectangle<T>.toDpRect(): DpRect
Link copied to clipboard
fun toOffset(coordinates: T, density: Density): Offset