summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/paint.c5
-rw-r--r--src/ui/window.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ui/paint.c b/src/ui/paint.c
index 8843e2e2..faaf403d 100644
--- a/src/ui/paint.c
+++ b/src/ui/paint.c
@@ -79,8 +79,9 @@ void unsetClip_Paint(iPaint *d) {
79#if SDL_VERSION_ATLEAST(2, 0, 12) 79#if SDL_VERSION_ATLEAST(2, 0, 12)
80 SDL_RenderSetClipRect(renderer_Paint_(d), NULL); 80 SDL_RenderSetClipRect(renderer_Paint_(d), NULL);
81#else 81#else
82 const SDL_Rect winRect = { 0, 0, d->dst->root->rect.size.x, d->dst->root->rect.size.y }; 82 const iRect rect =
83 SDL_RenderSetClipRect(renderer_Paint_(d), &winRect); 83 current_Root() ? rect_Root(get_Root()) : (iRect){ zero_I2(), get_Window()->size };
84 SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect);
84#endif 85#endif
85} 86}
86 87
diff --git a/src/ui/window.c b/src/ui/window.c
index 80504aae..39adba83 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -998,6 +998,8 @@ void draw_Window(iWindow *d) {
998#endif 998#endif
999 const int winFlags = SDL_GetWindowFlags(d->win); 999 const int winFlags = SDL_GetWindowFlags(d->win);
1000 const iBool gotFocus = (winFlags & SDL_WINDOW_INPUT_FOCUS) != 0; 1000 const iBool gotFocus = (winFlags & SDL_WINDOW_INPUT_FOCUS) != 0;
1001 iPaint p;
1002 init_Paint(&p);
1001 /* Clear the window. The clear color is visible as a border around the window 1003 /* Clear the window. The clear color is visible as a border around the window
1002 when the custom frame is being used. */ { 1004 when the custom frame is being used. */ {
1003#if defined (iPlatformAppleMobile) 1005#if defined (iPlatformAppleMobile)
@@ -1008,6 +1010,7 @@ void draw_Window(iWindow *d) {
1008 ? uiAnnotation_ColorId 1010 ? uiAnnotation_ColorId
1009 : uiSeparator_ColorId); 1011 : uiSeparator_ColorId);
1010#endif 1012#endif
1013 unsetClip_Paint(&p); /* update clip to full window */
1011 SDL_SetRenderDrawColor(d->render, back.r, back.g, back.b, 255); 1014 SDL_SetRenderDrawColor(d->render, back.r, back.g, back.b, 255);
1012 SDL_RenderClear(d->render); 1015 SDL_RenderClear(d->render);
1013 } 1016 }
@@ -1019,6 +1022,7 @@ void draw_Window(iWindow *d) {
1019 iRoot *root = d->roots[i]; 1022 iRoot *root = d->roots[i];
1020 if (root) { 1023 if (root) {
1021 setCurrent_Root(root); 1024 setCurrent_Root(root);
1025 unsetClip_Paint(&p); /* update clip to current root */
1022 draw_Widget(root->widget); 1026 draw_Widget(root->widget);
1023#if defined (LAGRANGE_ENABLE_CUSTOM_FRAME) 1027#if defined (LAGRANGE_ENABLE_CUSTOM_FRAME)
1024 /* App icon. */ 1028 /* App icon. */
@@ -1040,8 +1044,6 @@ void draw_Window(iWindow *d) {
1040#endif 1044#endif
1041 /* Root separator and keyboard focus indicator. */ 1045 /* Root separator and keyboard focus indicator. */
1042 if (numRoots_Window(d) > 1){ 1046 if (numRoots_Window(d) > 1){
1043 iPaint p;
1044 init_Paint(&p);
1045 const iRect bounds = bounds_Widget(root->widget); 1047 const iRect bounds = bounds_Widget(root->widget);
1046 if (i == 1) { 1048 if (i == 1) {
1047 fillRect_Paint(&p, (iRect){ 1049 fillRect_Paint(&p, (iRect){