From 1cf4371b6908492952c0ef789e9f7566557d3cf1 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 10 Mar 2018 16:22:44 +0000 Subject: Android: fixed some variables to avoid crashing. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12730 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Android/Fl_Android_Graphics_Driver.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 2a0b62cc8..b71f1adbb 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx @@ -54,10 +54,14 @@ 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_Rect_Region r(x, y, w, h); - if (r.intersect_with(&pWindowRegion)) { - rectf_unclipped(r.x(), r.y(), r.w(), r.h()); + if (pWindowRegion) { + Fl_Android_Application::log_w("rectf %g %g %g %g", x, y, w, h); + Fl_Rect_Region r(x, y, w, h); + if (r.intersect_with(pWindowRegion)) { + rectf_unclipped(r.x(), r.y(), r.w(), r.h()); + } + } else { + rectf_unclipped(x, y, w, h); } /* -- cgit v1.2.3