From 9876ac3361c77a28a55e7843d6db1dc781f93d95 Mon Sep 17 00:00:00 2001 From: that Date: Sun, 15 Feb 2015 21:40:59 +0100 Subject: gui: support scrollable lists without headers If the
element doesn't exist, the header is not drawn. - minuitwrp: add function for clipping all drawing to a rectangle ...and another one to cancel it. Change-Id: If0f688a5debee6ebd9c457999fe571705a42c5cc --- minuitwrp/graphics.c | 14 ++++++++++++++ minuitwrp/minui.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'minuitwrp') diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index 93123e40a..7160c7e2e 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -558,6 +558,20 @@ int gr_textExWH(int x, int y, const char *s, void* pFont, int max_width, int max return x; } +void gr_clip(int x, int y, int w, int h) +{ + GGLContext *gl = gr_context; + gl->scissor(gl, x, y, w, h); + gl->enable(gl, GGL_SCISSOR_TEST); +} + +void gr_noclip() +{ + GGLContext *gl = gr_context; + gl->scissor(gl, 0, 0, gr_fb_width(), gr_fb_height()); + gl->disable(gl, GGL_SCISSOR_TEST); +} + void gr_fill(int x, int y, int w, int h) { GGLContext *gl = gr_context; diff --git a/minuitwrp/minui.h b/minuitwrp/minui.h index fff7ddb97..8ef04445c 100644 --- a/minuitwrp/minui.h +++ b/minuitwrp/minui.h @@ -36,6 +36,8 @@ void gr_flip(void); int gr_fb_blank(int blank); void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a); +void gr_clip(int x, int y, int w, int h); +void gr_noclip(); void gr_fill(int x, int y, int w, int h); int gr_textEx(int x, int y, const char *s, void* font); -- cgit v1.2.3