changeset 1450:145edf67013e

Fixed accidentally flipping splitbars vertically on Windows in that last commit.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 14 Dec 2011 01:19:50 +0000
parents 632346743f46
children 95ca625b8ffc
files win/dw.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Wed Dec 14 00:23:30 2011 +0000
+++ b/win/dw.c	Wed Dec 14 01:19:50 2011 +0000
@@ -2973,7 +2973,6 @@
 {
    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);
 
    ShowWindow(handle1, SW_HIDE);
    ShowWindow(handle2, SW_HIDE);
@@ -2982,6 +2981,7 @@
    {
       int newx = x;
       float ratio = (float)percent/(float)100.0;
+      Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA);
 
       newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2);
 
@@ -3001,17 +3001,18 @@
    {
       int newy = y;
       float ratio = (float)(100.0-percent)/(float)100.0;
+      Box *tmp = (Box *)GetWindowLongPtr(handle2, GWLP_USERDATA);
 
       newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2);
 
-      MoveWindow(handle1, 0, y - newy, x, newy, FALSE);
+      MoveWindow(handle2, 0, y - newy, x, newy, FALSE);
       _do_resize(tmp, x - 1, newy - 1);
 
-      tmp = (Box *)GetWindowLongPtr(handle2, GWLP_USERDATA);
+      tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA);
 
       newy = y - newy - SPLITBAR_WIDTH;
 
-      MoveWindow(handle2, 0, 0, x, newy, FALSE);
+      MoveWindow(handle1, 0, 0, x, newy, FALSE);
       _do_resize(tmp, x - 1, newy - 1);
 
       dw_window_set_data(hwnd, "_dw_start", (void *)newy);