Переглянути джерело

Refactor: When zooming the animation window don't allow time offset into sub-zero range
- Also don't center on the cursor location, it's more confusing than useful

BearishSun 6 роки тому
батько
коміт
1482fc13dc

+ 1 - 6
Source/EditorManaged/Windows/Animation/GUICurveEditor.cs

@@ -1483,6 +1483,7 @@ namespace bs.Editor
 
             Vector2 currentRange = Range;
             Vector2 newRange = currentRange + zoomedDiff;
+            newRange.x = Math.Max(0, newRange.x);
             Range = newRange;
 
             // When zooming, make sure to focus on the point provided, so adjust the offset
@@ -1490,12 +1491,6 @@ namespace bs.Editor
             rangeScale.x /= currentRange.x;
             rangeScale.y /= currentRange.y;
 
-            Vector2 relativeCurvePos = curvePos - Offset;
-            Vector2 newCurvePos = relativeCurvePos * rangeScale;
-            Vector2 diff = newCurvePos - relativeCurvePos;
-
-            Offset -= diff;
-
             UpdateScrollBarSize();
             UpdateScrollBarPosition();
         }