Mercurial > dwindows
diff win/dw.c @ 542:a95f39e81fe2
Fixed optimization errors on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 01 Apr 2004 07:48:52 +0000 |
parents | 8f80ed604a89 |
children | 536b32eb0cb0 |
line wrap: on
line diff
--- a/win/dw.c Thu Apr 01 07:42:17 2004 +0000 +++ b/win/dw.c Thu Apr 01 07:48:52 2004 +0000 @@ -2691,13 +2691,17 @@ void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y) { + HWND handle1, handle2; + Box *tmp; + if(type == DW_HORZ) { int newx = x; float ratio = (float)percent/(float)100.0; - HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); - HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); - Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); + + handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); + handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); + tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2); @@ -2720,9 +2724,10 @@ { int newy = y; float ratio = (float)(100.0-percent)/(float)100.0; - HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); - HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); - Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); + + handle1 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); + handle2 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); + tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2);