Merge branch 'underline-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-underline-fix
This commit is contained in:
@@ -290,7 +290,7 @@ namespace FlaxEngine.GUI
|
|||||||
{
|
{
|
||||||
var leftEdge = selection.StartIndex <= textBlock.Range.StartIndex ? textBlock.Bounds.UpperLeft : font.GetCharPosition(_text, selection.StartIndex);
|
var leftEdge = selection.StartIndex <= textBlock.Range.StartIndex ? textBlock.Bounds.UpperLeft : font.GetCharPosition(_text, selection.StartIndex);
|
||||||
var rightEdge = selection.EndIndex >= textBlock.Range.EndIndex ? textBlock.Bounds.UpperRight : font.GetCharPosition(_text, selection.EndIndex);
|
var rightEdge = selection.EndIndex >= textBlock.Range.EndIndex ? textBlock.Bounds.UpperRight : font.GetCharPosition(_text, selection.EndIndex);
|
||||||
float height = font.Height / DpiScale;
|
float height = font.Height;
|
||||||
float alpha = Mathf.Min(1.0f, Mathf.Cos(_animateTime * BackgroundSelectedFlashSpeed) * 0.5f + 1.3f);
|
float alpha = Mathf.Min(1.0f, Mathf.Cos(_animateTime * BackgroundSelectedFlashSpeed) * 0.5f + 1.3f);
|
||||||
alpha *= alpha;
|
alpha *= alpha;
|
||||||
Color selectionColor = Color.White * alpha;
|
Color selectionColor = Color.White * alpha;
|
||||||
@@ -340,7 +340,7 @@ namespace FlaxEngine.GUI
|
|||||||
if (textBlock.Style.UnderlineBrush != null)
|
if (textBlock.Style.UnderlineBrush != null)
|
||||||
{
|
{
|
||||||
var underLineHeight = 2.0f;
|
var underLineHeight = 2.0f;
|
||||||
var height = font.Height / DpiScale;
|
var height = font.Height;
|
||||||
var underlineRect = new Rectangle(textBlock.Bounds.Location.X, textBlock.Bounds.Location.Y + height - underLineHeight * 0.5f, textBlock.Bounds.Width, underLineHeight);
|
var underlineRect = new Rectangle(textBlock.Bounds.Location.X, textBlock.Bounds.Location.Y + height - underLineHeight * 0.5f, textBlock.Bounds.Width, underLineHeight);
|
||||||
textBlock.Style.UnderlineBrush.Draw(underlineRect, textBlock.Style.Color);
|
textBlock.Style.UnderlineBrush.Draw(underlineRect, textBlock.Style.Color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user