From 468488677ae2b62aa5ae2bc8994d75d2d3167362 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Wed, 5 Apr 2023 22:37:05 +0930 Subject: [PATCH] lua cairo: Add cairo_surface_create_for_rectangle (#1492) Adds the function for cairo_surface_create_for_rectangle copied from the cairo header files. Personally I use this to ensure that Items can't draw outside there designated area. --- lua/cairo.pkg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/cairo.pkg b/lua/cairo.pkg index e8f0318f..1ac412d2 100644 --- a/lua/cairo.pkg +++ b/lua/cairo.pkg @@ -706,6 +706,12 @@ const char *cairo_status_to_string(cairo_status_t status); cairo_surface_t *cairo_surface_create_similar(cairo_surface_t * other, cairo_content_t content, int width, int height); +cairo_surface_t *cairo_surface_create_for_rectangle (cairo_surface_t *target, + double x, + double y, + double width, + double height); + cairo_surface_t *cairo_surface_reference(cairo_surface_t * surface); void cairo_surface_finish(cairo_surface_t * surface);