Browse Source

Fixed panel scaling to behave like windows native

vurtun 8 years ago
parent
commit
d9a57d42cd
2 changed files with 11 additions and 6 deletions
  1. 2 1
      CHANGELOG.txt
  2. 9 5
      nuklear.h

+ 2 - 1
CHANGELOG.md → CHANGELOG.txt

@@ -1,7 +1,7 @@
 # Changelog
 # Changelog
 [date][x.yy.zz]-[description]
 [date][x.yy.zz]-[description]
 
 
-- [date]: current date on which the change has been pushed
+- [date]: date on which the change has been pushed
 - [x.yy.zz]: Numerical version string representation. Each version number on the right
 - [x.yy.zz]: Numerical version string representation. Each version number on the right
              resets back to zero if version on the left is incremented.
              resets back to zero if version on the left is incremented.
     - [x]: Major version with API and library breaking (extremly rare, maybe never)
     - [x]: Major version with API and library breaking (extremly rare, maybe never)
@@ -11,6 +11,7 @@
 
 
 Changes:
 Changes:
 --------
 --------
+- 2017/05/10 (1.38.3) - Fixed wrong min window size mouse scaling over boundries
 - 2017/05/09 (1.38.2) - Fixed vertical scrollbar drawing with not enough space
 - 2017/05/09 (1.38.2) - Fixed vertical scrollbar drawing with not enough space
 - 2017/05/09 (1.38.1) - Fixed scaler dragging behavior if window size hits minimum size
 - 2017/05/09 (1.38.1) - Fixed scaler dragging behavior if window size hits minimum size
 - 2017/05/06 (1.38.0) - Added platform double-click support
 - 2017/05/06 (1.38.0) - Added platform double-click support

+ 9 - 5
nuklear.h

@@ -17946,15 +17946,19 @@ nk_panel_end(struct nk_context *ctx)
                     window->bounds.x += in->mouse.delta.x;
                     window->bounds.x += in->mouse.delta.x;
                 }
                 }
                 /* dragging in x-direction  */
                 /* dragging in x-direction  */
-                if (window_size.x < window->bounds.w + delta_x) {
-                    window->bounds.w = window->bounds.w + delta_x;
-                    scaler.x += in->mouse.delta.x;
+                if (window->bounds.w + delta_x >= window_size.x) {
+                    if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
+                        window->bounds.w = window->bounds.w + delta_x;
+                        scaler.x += in->mouse.delta.x;
+                    }
                 }
                 }
                 /* dragging in y-direction (only possible if static window) */
                 /* dragging in y-direction (only possible if static window) */
                 if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
                 if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
                     if (window_size.y < window->bounds.h + in->mouse.delta.y) {
                     if (window_size.y < window->bounds.h + in->mouse.delta.y) {
-                        window->bounds.h = window->bounds.h + in->mouse.delta.y;
-                        scaler.y += in->mouse.delta.y;
+                        if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
+                            window->bounds.h = window->bounds.h + in->mouse.delta.y;
+                            scaler.y += in->mouse.delta.y;
+                        }
                     }
                     }
                 }
                 }
                 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
                 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];