class

UIng::Area::Draw::Context

Inherits UIng::BlockConstructor < Reference < Object

Constructors

new(*args, &)
Source
new(*args, **kwargs, &)
Source
new(ref_ptr : Pointer(LibUI::DrawContext))
Source

Instance methods

clip(path : Path) : Nil

Low-level clipping: apply a finished path as clip

Source
clip_path(mode : FillMode = FillMode::Winding, &)

High-level clipping: build a path in a block, end it, and clip

Source
draw_fill(path : Path, brush : Brush) : Nil

Low-level: fill an ended path

Source
draw_image(img : UIng::Image, x : Number, y : Number, width : Number, height : Number) : Nil
Source
draw_path(mode : FillMode = FillMode::Winding, fill : Bool = true, stroke : Bool = false, fill_brush : Brush | Nil = nil, stroke_brush : Brush | Nil = nil, stroke_params : StrokeParams | Nil = nil, &)

High-level: build once, then optionally fill and/or stroke

Source
draw_stroke(path : Path, brush : Brush, stroke_params : StrokeParams) : Nil

Low-level: stroke an ended path

Source
draw_stroke(path : Path, brush : Brush, cap : UIng::Area::Draw::LineCap = LineCap::Flat, join : UIng::Area::Draw::LineJoin = LineJoin::Miter, thickness : Number = 1.0, miter_limit : Number = 10.0, dash_phase : Number = 0.0, dashes : Enumerable(Float64) | Nil = nil) : Nil

Convenience overload to build StrokeParams inline

Source
draw_text_layout(text_layout : TextLayout, x : Float64, y : Float64) : Nil

Text drawing (libui uiDrawText equivalent)

Source
fill_path(brush : Brush, mode : FillMode = FillMode::Winding, &)

High-level: build a path in a block, end it, and fill

Source
restore
Source
save

Save/restore helpers

Source
stroke_path(brush : Brush, stroke_params : StrokeParams, mode : FillMode = FillMode::Winding, &)

High-level: build a path in a block, end it, and stroke

Source
stroke_path(brush : Brush, cap : UIng::Area::Draw::LineCap = LineCap::Flat, join : UIng::Area::Draw::LineJoin = LineJoin::Miter, thickness : Number = 1.0, miter_limit : Number = 10.0, dash_phase : Number = 0.0, dashes : Enumerable(Float64) | Nil = nil, mode : FillMode = FillMode::Winding, &block : Path -> Nil) : Nil
Source
to_unsafe
Source
transform(matrix : Matrix) : Nil

Matrix composition (same semantics as libui's uiDrawTransform)

Source