From 5591ba811aab2fc67255a4bc469e86ecc1fad37d Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 10 Mar 2018 13:17:41 +0000 Subject: Android: adding and fixing to the graphics clipping code Android has no classic window manager, so FLTK has to make sure that popup windows, dialog boxes and multi window interfaces work as expectd. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Android/Fl_Android_Graphics_Driver.cxx | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/drivers/Android/Fl_Android_Graphics_Driver.cxx') diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx index 1df52462a..2a0b62cc8 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx @@ -55,10 +55,32 @@ static uint16_t make565(Fl_Color crgba) void Fl_Android_Graphics_Driver::rectf_unscaled(float x, float y, float w, float h) { Fl_Android_Application::log_w("rectf %g %g %g %g", x, y, w, h); - Fl_Clip_Rect r(x, y, w, h); - if (r.intersect_with(&pClipRect)) { + Fl_Rect_Region r(x, y, w, h); + if (r.intersect_with(&pWindowRegion)) { rectf_unclipped(r.x(), r.y(), r.w(), r.h()); } + + /* + * rectf(x, y, w, h) { + * rectf(complex_window_region, drawing_rect(x, y, w, h)) + * } + * + * rectf( complexRgn, drawRgn) { + * // B: start of iterator + * if (intersect(rect_of_complexRgn, drawRgn) { + * if (complexRgn->is_complex() { + * rectf(complexRgn->subregion, drawRect); + * } else { + * rawRect = intersection(rect_of_complexRgn, drawRgn); + * rawDrawRect(rawRect); + * } + * } + * // A: recursion + * if (complexRgn->next) + * rectf(complexRgn->next, drawRgn); + * // B: end of iterator + * } + */ } void Fl_Android_Graphics_Driver::rectf_unclipped(float x, float y, float w, float h) { -- cgit v1.2.3