aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-10-02 03:34:17 +0200
committerStapleButter <thetotalworm@gmail.com>2017-10-02 03:34:17 +0200
commitd0770596ea1e05f5a5d051cc461a2305d0f458fc (patch)
tree59a71f5b9d676729b3890cdc009a2e3f32cf343d /src/libui_sdl/libui
parent09920126ddcc84d98e333287566d8483ad3410a8 (diff)
re-add basic scaling
Diffstat (limited to 'src/libui_sdl/libui')
-rw-r--r--src/libui_sdl/libui/ui.h3
-rw-r--r--src/libui_sdl/libui/windows/area.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/ui.h b/src/libui_sdl/libui/ui.h
index f1937e2..84a71c3 100644
--- a/src/libui_sdl/libui/ui.h
+++ b/src/libui_sdl/libui/ui.h
@@ -288,6 +288,8 @@ typedef struct uiAreaKeyEvent uiAreaKeyEvent;
typedef struct uiDrawContext uiDrawContext;
+// TO CONSIDER: the uiAreaHandler param there seems useless
+// (might use individual callbacks instead of handler struct?)
struct uiAreaHandler {
void (*Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *);
// TODO document that resizes cause a full redraw for non-scrolling areas; implementation-defined for scrolling areas
@@ -297,6 +299,7 @@ struct uiAreaHandler {
void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left);
void (*DragBroken)(uiAreaHandler *, uiArea *);
int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *);
+ void (*Resize)(uiAreaHandler *, uiArea *, int, int);
};
// TODO RTL layouts?
diff --git a/src/libui_sdl/libui/windows/area.cpp b/src/libui_sdl/libui/windows/area.cpp
index 74fe768..6bb8fe7 100644
--- a/src/libui_sdl/libui/windows/area.cpp
+++ b/src/libui_sdl/libui/windows/area.cpp
@@ -37,6 +37,11 @@ static LRESULT CALLBACK areaWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
uiWindowsEnsureGetClientRect(a->hwnd, &client);
areaDrawOnResize(a, &client);
areaScrollOnResize(a, &client);
+ {
+ double w, h;
+ loadAreaSize(a, a->rt, &w, &h);
+ a->ah->Resize(a->ah, a, (int)w, (int)h);
+ }
return 0;
}