Skip to content

修复输入文本里,点击一行末尾的空白处时,会定位到下一行开头的问题 #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Assets/Scripts/Core/Text/InputTextField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace FairyGUI
public class InputTextField : RichTextField
{
/// <summary>
///
///
/// </summary>
public int maxLength { get; set; }

Expand All @@ -24,37 +24,37 @@ public class InputTextField : RichTextField
public bool keyboardInput { get; set; }

/// <summary>
///
///
/// </summary>
public int keyboardType { get; set; }

/// <summary>
///
///
/// </summary>
public bool hideInput { get; set; }

/// <summary>
///
///
/// </summary>
public bool disableIME { get; set; }

/// <summary>
///
///
/// </summary>
public bool mouseWheelEnabled { get; set; }

/// <summary>
///
///
/// </summary>
public static Action<InputTextField, string> onCopy;

/// <summary>
///
///
/// </summary>
public static Action<InputTextField> onPaste;

/// <summary>
///
///
/// </summary>
public static PopupMenu contextMenu;

Expand Down Expand Up @@ -119,23 +119,23 @@ public InputTextField()
}

/// <summary>
///
///
/// </summary>
public EventListener onChanged
{
get { return _onChanged ?? (_onChanged = new EventListener(this, "onChanged")); }
}

/// <summary>
///
///
/// </summary>
public EventListener onSubmit
{
get { return _onSubmit ?? (_onSubmit = new EventListener(this, "onSubmit")); }
}

/// <summary>
///
///
/// </summary>
public override string text
{
Expand All @@ -152,7 +152,7 @@ public override string text
}

/// <summary>
///
///
/// </summary>
public override TextFormat textFormat
{
Expand All @@ -172,7 +172,7 @@ public override TextFormat textFormat
}

/// <summary>
///
///
/// </summary>
public string restrict
{
Expand All @@ -188,7 +188,7 @@ public string restrict
}

/// <summary>
///
///
/// </summary>
public int caretPosition
{
Expand All @@ -214,7 +214,7 @@ public int selectionEndIndex
}

/// <summary>
///
///
/// </summary>
public string promptText
{
Expand All @@ -234,7 +234,7 @@ public string promptText
}

/// <summary>
///
///
/// </summary>
public bool displayAsPassword
{
Expand All @@ -250,7 +250,7 @@ public bool displayAsPassword
}

/// <summary>
///
///
/// </summary>
public bool editable
{
Expand All @@ -264,7 +264,7 @@ public bool editable
}

/// <summary>
///
///
/// </summary>
public int border
{
Expand All @@ -277,7 +277,7 @@ public int border
}

/// <summary>
///
///
/// </summary>
public int corner
{
Expand All @@ -290,7 +290,7 @@ public int corner
}

/// <summary>
///
///
/// </summary>
public Color borderColor
{
Expand All @@ -303,7 +303,7 @@ public Color borderColor
}

/// <summary>
///
///
/// </summary>
public Color backgroundColor
{
Expand Down Expand Up @@ -337,7 +337,7 @@ void UpdateShape()
}

/// <summary>
///
///
/// </summary>
/// <param name="start"></param>
/// <param name="length">-1 means the rest count from start</param>
Expand All @@ -360,7 +360,7 @@ public void SetSelection(int start, int length)
}

/// <summary>
///
///
/// </summary>
/// <param name="value"></param>
public void ReplaceSelection(string value)
Expand Down Expand Up @@ -426,7 +426,7 @@ public void ReplaceSelection(string value)
}

/// <summary>
///
///
/// </summary>
/// <param name="value"></param>
public void ReplaceText(string value)
Expand Down Expand Up @@ -818,7 +818,7 @@ TextField.CharPosition GetCharPosition(Vector2 location)
return v;
}
else if (firstInLine != -1)
return v;
return textField.charPositions[i - 1];
}

return textField.charPositions[i - 1];
Expand Down