Skip to content

Commit

Permalink
Merge pull request #63 from JasonMa0012/2.x
Browse files Browse the repository at this point in the history
Fix Ramp Editor: Selecting another Key while editing Time causes the …
  • Loading branch information
JasonMa0012 authored Sep 14, 2024
2 parents c883023 + b3720b2 commit b0ea2cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ private GradientEditor.Swatch _selectedGradientKey
private int _lastGradientAlphaSwatchesCount;

private float _lastEditingTime = float.NegativeInfinity;
private bool _lastIsEditingText;

private static bool _isAddGradientKeyFailure;

Expand Down Expand Up @@ -351,7 +350,7 @@ private void OnGradientEditFieldGUI()
if (_lastEditingTime != selectionInfo.selectedTime
&& _lastEditingTime != float.NegativeInfinity
// End editing text
&& (!EditorGUI.IsEditingTextField() && _lastIsEditingText
&& (EditorGUI.IsEditingTextField() && Event.current.keyCode == KeyCode.Return
// Mouse drag
|| !EditorGUI.IsEditingTextField() && hasChange))
{
Expand All @@ -360,8 +359,6 @@ private void OnGradientEditFieldGUI()
InitGradientEditor(true);
SyncSelectionFromCurveToGradient(true);
}

_lastIsEditingText = EditorGUI.IsEditingTextField();
}

// Vector Value
Expand Down Expand Up @@ -827,7 +824,6 @@ public void Clear()
_curveEditor?.OnDisable();
_curveEditor = null;
_lastChanged = false;
_lastIsEditingText = false;
_lastEditingTime = float.NegativeInfinity;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.jasonma.lwgui",
"version": "1.18.8",
"version": "1.18.9",
"displayName": "LWGUI",
"description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.",
"keywords": [
Expand Down

0 comments on commit b0ea2cd

Please sign in to comment.