Bugfix #28298
[blender.git] / source / blender / editors / interface / view2d.c
index 559602b04c04314c5abb405e6d9e8bb4987ae4f9..fb7a26155838fcd6e161ba548449c180047c0104 100644 (file)
@@ -476,8 +476,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
                                if (winy < v2d->oldwiny) {
                                        float temp = v2d->oldwiny - winy;
                                        
-                                       cur->ymin += temp;
-                                       cur->ymax += temp;
+                                       if (v2d->align & V2D_ALIGN_NO_NEG_Y) {
+                                               cur->ymin -= temp;
+                                               cur->ymax -= temp;
+                                       }
+                                       else { /* Assume V2D_ALIGN_NO_POS_Y or combination */
+                                               cur->ymin += temp;
+                                               cur->ymax += temp;
+                                       }
                                }
 
                        }