LavaUI docs GitHub

struct DragChipImage

Swift

struct DragChipImage

A drag chip: views laid out and emitted into a draw list of their own.

The arrays are canvas's own DrawCommand, GlyphInstance, MeshVertex and GradientDesc structs, as bytes. Whoever draws it compiles against the same draw_command.hpp, so this is the frame format rather than a new one — and a chip is a few kilobytes, sent once when the drag starts.

Chip-local: the list is emitted with the chip's top-left at 0,0, and width × height is what it laid out to, in pixels.

Sources/LavaUI/DragSource.swift:20

Properties

var byteCount: Int { get }

Total size of the four arrays, compared against maxWireBytes.

Sources/LavaUI/DragSource.swift:40

var commands: [UInt8]

The chip's draw commands (canvas DrawCommands), as bytes.

Sources/LavaUI/DragSource.swift:26

var glyphs: [UInt8]

The glyph instances the commands refer to (canvas GlyphInstances), as bytes.

Sources/LavaUI/DragSource.swift:28

var gradients: [UInt8]

Gradient descriptions the commands refer to (canvas GradientDescs), as bytes.

Sources/LavaUI/DragSource.swift:32

var height: UInt32

Height the chip laid out to, in pixels.

Sources/LavaUI/DragSource.swift:24

static let maxWireBytes: Int

Past this a chip is not sent, and the drag goes ahead with the cursor alone. Well under the control plane's per-message ceiling; a chip that big is a window, not a chip.

Sources/LavaUI/DragSource.swift:37

var meshVertices: [UInt8]

Mesh vertices the commands refer to (canvas MeshVertexes), as bytes.

Sources/LavaUI/DragSource.swift:30

var width: UInt32

Width the chip laid out to, in pixels.

Sources/LavaUI/DragSource.swift:22