Просмотр исходного кода

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 лет назад
Родитель
Сommit
1482fc13dc
1 измененных файлов с 1 добавлено и 6 удалено
  1. 1 6
      Source/EditorManaged/Windows/Animation/GUICurveEditor.cs

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

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