From 707d8da799b39a0fd38660b7c5c1639fd001585f Mon Sep 17 00:00:00 2001 From: and3md Date: Sun, 21 May 2017 11:18:12 +0200 Subject: [PATCH 1/2] SDL app use update() after events, fix always redraw when mouse move, related to #347 --- src/dlangui/platforms/sdl/sdlapp.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dlangui/platforms/sdl/sdlapp.d b/src/dlangui/platforms/sdl/sdlapp.d index d0e7c40b..b07e93e9 100644 --- a/src/dlangui/platforms/sdl/sdlapp.d +++ b/src/dlangui/platforms/sdl/sdlapp.d @@ -722,7 +722,7 @@ class SDLWindow : Window { bool res = dispatchMouseEvent(event); if (res) { debug(mouse) Log.d("Calling update() after mouse event"); - invalidate(); + update(); } } } @@ -951,7 +951,7 @@ class SDLWindow : Window { bool res = dispatchKeyEvent(new KeyEvent(KeyAction.Text, 0, flags, ds)); if (res) { debug(DebugSDL) Log.d("Calling update() after text event"); - invalidate(); + update(); } return res; } @@ -1026,7 +1026,7 @@ class SDLWindow : Window { // } if (res) { debug(DebugSDL) Log.d("Calling update() after key event"); - invalidate(); + update(); } return res; } From 65845759a2d290a5be51916d93a76c612f09497a Mon Sep 17 00:00:00 2001 From: and3md Date: Sun, 21 May 2017 11:25:27 +0200 Subject: [PATCH 2/2] SwitchButton set _needDraw to false after draw, fix always redraw after events, related to #347 --- src/dlangui/widgets/controls.d | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dlangui/widgets/controls.d b/src/dlangui/widgets/controls.d index f408a961..cd015f3a 100644 --- a/src/dlangui/widgets/controls.d +++ b/src/dlangui/widgets/controls.d @@ -211,6 +211,7 @@ class SwitchButton : Widget { uint st = state; img.drawTo(buf, rc, st); } + _needDraw = false; } }