Restrict drawing to rect (intersected with the clip already in force) until pop_clip.
- ui: the UI whose display list gets the clip.
- rect: the area to keep, in points.
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 := 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);