summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-03 08:46:49 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-03 08:46:49 +0300
commit47e7811386c9b06fd7b458e9afb527018ad80c03 (patch)
tree07e8b72a726cfae3060647d152ce797663332b30 /src/ui/window.c
parent311a59df5552ae7ad52e1f001487112a300889c0 (diff)
Paint: Fixed build with older SDL versions
IssueID #259
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c6
1 files changed, 4 insertions, 2 deletions
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){