Merge remote-tracking branch 'origin/master' into 1.9
# Conflicts: # Source/Editor/Modules/ContentDatabaseModule.cs # Source/Editor/Surface/SurfaceUtils.cs # Source/Editor/Windows/Assets/MaterialInstanceWindow.cs # Source/Engine/Foliage/Foliage.cpp # Source/Engine/Graphics/Models/MeshBase.h # Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Textures.cpp
This commit is contained in:
@@ -924,6 +924,19 @@ namespace FlaxEngine.GUI
|
||||
return newLineLoc;
|
||||
}
|
||||
|
||||
private int FindNextLineBegin()
|
||||
{
|
||||
int caretPos = CaretPosition;
|
||||
if (caretPos + 2 > TextLength)
|
||||
return TextLength;
|
||||
int newLineLoc = _text.IndexOf('\n', caretPos + 2);
|
||||
if (newLineLoc == -1)
|
||||
newLineLoc = TextLength;
|
||||
else
|
||||
newLineLoc++;
|
||||
return newLineLoc;
|
||||
}
|
||||
|
||||
private int FindLineDownChar(int index)
|
||||
{
|
||||
if (!IsMultiline)
|
||||
@@ -1423,6 +1436,30 @@ namespace FlaxEngine.GUI
|
||||
|
||||
return true;
|
||||
}
|
||||
case KeyboardKeys.PageDown:
|
||||
{
|
||||
if (IsScrollable && IsMultiline)
|
||||
{
|
||||
var location = GetCharPosition(_selectionStart, out var height);
|
||||
var sizeHeight = Size.Y / height;
|
||||
location.Y += height * (int)sizeHeight;
|
||||
TargetViewOffset = Vector2.Clamp(new Float2(0, location.Y), Float2.Zero, TextSize - new Float2(0, Size.Y));
|
||||
SetSelection(HitTestText(location));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case KeyboardKeys.PageUp:
|
||||
{
|
||||
if (IsScrollable && IsMultiline)
|
||||
{
|
||||
var location = GetCharPosition(_selectionStart, out var height);
|
||||
var sizeHeight = Size.Y / height;
|
||||
location.Y -= height * (int)sizeHeight;
|
||||
TargetViewOffset = Vector2.Clamp(new Float2(0, location.Y), Float2.Zero, TextSize - new Float2(0, Size.Y));
|
||||
SetSelection(HitTestText(location));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case KeyboardKeys.Delete:
|
||||
{
|
||||
if (IsReadOnly)
|
||||
@@ -1491,8 +1528,13 @@ namespace FlaxEngine.GUI
|
||||
return true;
|
||||
case KeyboardKeys.End:
|
||||
{
|
||||
// Select text from the current cursor point to the beginning of a new line
|
||||
if (shiftDown && _selectionStart != -1)
|
||||
SetSelection(_selectionStart, FindNextLineBegin());
|
||||
// Move caret after last character
|
||||
SetSelection(TextLength);
|
||||
else
|
||||
SetSelection(TextLength);
|
||||
|
||||
return true;
|
||||
}
|
||||
case KeyboardKeys.Tab:
|
||||
|
||||
@@ -750,7 +750,7 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
if (base.IsTouchOver)
|
||||
return true;
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
if (_children[i].IsTouchOver)
|
||||
return true;
|
||||
@@ -960,7 +960,7 @@ namespace FlaxEngine.GUI
|
||||
public override void OnMouseLeave()
|
||||
{
|
||||
// Check all children collisions with mouse and fire events for them
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.Visible && child.Enabled && child.IsMouseOver)
|
||||
@@ -1063,7 +1063,7 @@ namespace FlaxEngine.GUI
|
||||
if (base.IsTouchPointerOver(pointerId))
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
if (_children[i].IsTouchPointerOver(pointerId))
|
||||
return true;
|
||||
@@ -1168,7 +1168,7 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override void OnTouchLeave(int pointerId)
|
||||
{
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.Visible && child.Enabled && child.IsTouchPointerOver(pointerId))
|
||||
@@ -1183,7 +1183,7 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override bool OnCharInput(char c)
|
||||
{
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.Enabled && child.ContainsFocus)
|
||||
@@ -1197,7 +1197,7 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override bool OnKeyDown(KeyboardKeys key)
|
||||
{
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.Enabled && child.ContainsFocus)
|
||||
@@ -1211,7 +1211,7 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override void OnKeyUp(KeyboardKeys key)
|
||||
{
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.Enabled && child.ContainsFocus)
|
||||
@@ -1294,7 +1294,7 @@ namespace FlaxEngine.GUI
|
||||
base.OnDragLeave();
|
||||
|
||||
// Check all children collisions with mouse and fire events for them
|
||||
for (int i = 0; i < _children.Count && _children.Count > 0; i++)
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
var child = _children[i];
|
||||
if (child.IsDragOver)
|
||||
|
||||
Reference in New Issue
Block a user