UI module

push_clip

procedureextensionexperimentalsince 0.31.0Source

Restrict drawing to rect (intersected with the clip already in force) until pop_clip.

Example↗
ui := headless();
defer free_ui(*ui);
push_clip(*ui, .{ 0, 0, 50, 50 });
draw_rect(*ui, .{ 0, 0, 100, 100 }, rgb(255, 255, 255));
pop_clip(*ui);
push_clip :: (ui: *UI_State, rect: Rect)

Restrict drawing to rect (intersected with the clip already in force) until pop_clip.

Parameters

ui: *UI_State
the UI whose display list gets the clip.
rect: Rect
the area to keep, in points.
Example↗
ui := headless();
defer free_ui(*ui);
push_clip(*ui, .{ 0, 0, 50, 50 });
draw_rect(*ui, .{ 0, 0, 100, 100 }, rgb(255, 255, 255));
pop_clip(*ui);

See also