RenderContext

class RenderContext(val width: Int, val height: Int, val renderOptions: RenderOptions, val lightDirection: Vector = SceneProjector.DEFAULT_LIGHT_DIRECTION.normalize(), accumulatedPosition: Point = Point(0.0, 0.0, 0.0), accumulatedRotation: Double = 0.0, accumulatedScale: Double = 1.0, rotationOrigin: Point? = null, scaleOrigin: Point? = null)

Context for rendering that accumulates transforms through the tree hierarchy

Marked as @Immutable to prevent unnecessary recomposition when instances don't change

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, renderOptions: RenderOptions, lightDirection: Vector = SceneProjector.DEFAULT_LIGHT_DIRECTION.normalize(), accumulatedPosition: Point = Point(0.0, 0.0, 0.0), accumulatedRotation: Double = 0.0, accumulatedScale: Double = 1.0, rotationOrigin: Point? = null, scaleOrigin: Point? = null)

Properties

Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard

Apply accumulated transforms to a path

Link copied to clipboard

Apply accumulated transforms to a point

Link copied to clipboard

Apply accumulated transforms to a shape

Link copied to clipboard
fun copy(width: Int = this.width, height: Int = this.height, renderOptions: RenderOptions = this.renderOptions, lightDirection: Vector = this.lightDirection): RenderContext
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Create a new context with overridden render options.

Link copied to clipboard
fun withTransform(position: Point = Point(0.0, 0.0, 0.0), rotation: Double = 0.0, scale: Double = 1.0, rotationOrigin: Point? = null, scaleOrigin: Point? = null): RenderContext

Create a new context with additional transforms