diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-06-04 15:53:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-04 15:53:08 +0200 |
commit | 97f4b5f70b67ea5cc142fbd1f3982c36b915a5d9 (patch) | |
tree | bd3fb3325db3743eef00cf3ddffafdeb644370a9 /src/libui_sdl/libui/windows/areautil.cpp | |
parent | f769d6e23f7635910e3f6659c6b55d8c6a8e96ff (diff) | |
parent | 3134c8fc66d1fbd5706930a3e3e64ce118406fe5 (diff) |
Merge branch 'master' into fast-forward-hotkey
Diffstat (limited to 'src/libui_sdl/libui/windows/areautil.cpp')
-rw-r--r-- | src/libui_sdl/libui/windows/areautil.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/libui_sdl/libui/windows/areautil.cpp b/src/libui_sdl/libui/windows/areautil.cpp index 212ea42..ea13221 100644 --- a/src/libui_sdl/libui/windows/areautil.cpp +++ b/src/libui_sdl/libui/windows/areautil.cpp @@ -2,20 +2,35 @@ #include "uipriv_windows.hpp" #include "area.hpp" -void loadAreaSize(uiArea *a, ID2D1RenderTarget *rt, double *width, double *height) +// TODO: make those int rather than double +void loadAreaSize(uiArea *a, double *width, double *height) { D2D1_SIZE_F size; + if (a->width != -1) + { + *width = (double)a->width; + *height = (double)a->height; + return; + } + *width = 0; *height = 0; if (!a->scrolling) { - if (rt == NULL) + /*if (rt == NULL) rt = a->rt; size = realGetSize(rt); *width = size.width; *height = size.height; - dipToPixels(a, width, height); + dipToPixels(a, width, height);*/ + RECT rect; + GetWindowRect(a->hwnd, &rect); + *width = (double)(rect.right - rect.left); + *height = (double)(rect.bottom - rect.top); } + + a->width = (int)*width; + a->height = (int)*height; } void pixelsToDIP(uiArea *a, double *x, double *y) |