Format code from recent PRs
This commit is contained in:
@@ -213,10 +213,12 @@ namespace FlaxEditor.Surface
|
||||
return;
|
||||
}
|
||||
|
||||
if (_middleMouseDown) {
|
||||
if (_middleMouseDown)
|
||||
{
|
||||
// Calculate delta
|
||||
var delta = location - _middleMouseDownPos;
|
||||
if (delta.LengthSquared > 0.01f) {
|
||||
if (delta.LengthSquared > 0.01f)
|
||||
{
|
||||
// Move view
|
||||
_mouseMoveAmount += delta.Length;
|
||||
_rootControl.Location += delta;
|
||||
@@ -284,7 +286,8 @@ namespace FlaxEditor.Surface
|
||||
_rightMouseDown = false;
|
||||
Cursor = CursorType.Default;
|
||||
}
|
||||
if (_middleMouseDown) {
|
||||
if (_middleMouseDown)
|
||||
{
|
||||
_middleMouseDown = false;
|
||||
Cursor = CursorType.Default;
|
||||
}
|
||||
@@ -310,7 +313,7 @@ namespace FlaxEditor.Surface
|
||||
if (IsMouseOver && !_leftMouseDown && !IsPrimaryMenuOpened)
|
||||
{
|
||||
var nextViewScale = ViewScale + delta * 0.1f;
|
||||
|
||||
|
||||
if (delta > 0 && !_rightMouseDown)
|
||||
{
|
||||
// Scale towards mouse when zooming in
|
||||
@@ -325,7 +328,7 @@ namespace FlaxEditor.Surface
|
||||
ViewScale = nextViewScale;
|
||||
ViewCenterPosition = viewCenter;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -419,7 +422,8 @@ namespace FlaxEditor.Surface
|
||||
_rightMouseDown = true;
|
||||
_rightMouseDownPos = location;
|
||||
}
|
||||
if (button == MouseButton.Middle) {
|
||||
if (button == MouseButton.Middle)
|
||||
{
|
||||
_middleMouseDown = true;
|
||||
_middleMouseDownPos = location;
|
||||
}
|
||||
@@ -537,7 +541,8 @@ namespace FlaxEditor.Surface
|
||||
}
|
||||
_mouseMoveAmount = 0;
|
||||
}
|
||||
if (_middleMouseDown && button == MouseButton.Middle) {
|
||||
if (_middleMouseDown && button == MouseButton.Middle)
|
||||
{
|
||||
_middleMouseDown = false;
|
||||
EndMouseCapture();
|
||||
Cursor = CursorType.Default;
|
||||
|
||||
@@ -912,7 +912,7 @@ namespace FlaxEditor.Surface
|
||||
{
|
||||
return _context.FindNode(id);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds the undo action to be batched (eg. if multiple undo actions is performed in a sequence during single update).
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace FlaxEngine.GUI
|
||||
/// The delete control character (used for text filtering).
|
||||
/// </summary>
|
||||
protected const char DelChar = (char)0x7F;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The text separators (used for words skipping).
|
||||
/// </summary>
|
||||
@@ -357,9 +357,9 @@ namespace FlaxEngine.GUI
|
||||
value = value.Replace("\r", "");
|
||||
|
||||
// Filter text (handle backspace control character)
|
||||
if(value.IndexOf(DelChar) != -1)
|
||||
if (value.IndexOf(DelChar) != -1)
|
||||
value = value.Replace(DelChar.ToString(), "");
|
||||
|
||||
|
||||
// Clamp length
|
||||
if (value.Length > MaxLength)
|
||||
value = value.Substring(0, MaxLength);
|
||||
@@ -1341,12 +1341,12 @@ namespace FlaxEngine.GUI
|
||||
if (ctrDown)
|
||||
{
|
||||
int prevWordBegin = FindPrevWordBegin();
|
||||
_text = _text.Remove(prevWordBegin, CaretPosition-prevWordBegin);
|
||||
_text = _text.Remove(prevWordBegin, CaretPosition - prevWordBegin);
|
||||
SetSelection(prevWordBegin);
|
||||
OnTextChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int left = SelectionLeft;
|
||||
if (HasSelection)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user