console dpi fix
This commit is contained in:
@@ -343,8 +343,9 @@ namespace Cabrito
|
||||
base.OnUpdate();
|
||||
|
||||
float targetY;
|
||||
float conHeight = rootControl.Control.Height /*/ Platform.DpiScale*/;
|
||||
if (!Console.IsOpen)
|
||||
targetY = -rootControl.Control.Height;
|
||||
targetY = -conHeight;
|
||||
else
|
||||
targetY = 0.0f;
|
||||
|
||||
@@ -364,8 +365,8 @@ namespace Cabrito
|
||||
else if (location.Y < targetY)
|
||||
{
|
||||
// opening
|
||||
if (location.Y < -rootControl.Control.Height * ConsoleHeight)
|
||||
location.Y = -rootControl.Control.Height * ConsoleHeight;
|
||||
if (location.Y < -conHeight * ConsoleHeight)
|
||||
location.Y = -conHeight * ConsoleHeight;
|
||||
|
||||
location.Y += Time.UnscaledDeltaTime * ConsoleSpeed;
|
||||
if (location.Y > targetY)
|
||||
@@ -381,8 +382,8 @@ namespace Cabrito
|
||||
}
|
||||
else if (!Console.IsOpen)
|
||||
{
|
||||
int fontHeight = consoleNotifyBox.Font.GetFont().Height;
|
||||
if (location.Y < (-rootControl.Control.Height * ConsoleHeight) + fontHeight)
|
||||
int fontHeight = (int)(consoleNotifyBox.Font.GetFont().Height / Platform.DpiScale);
|
||||
if (location.Y < (-conHeight * ConsoleHeight) + fontHeight)
|
||||
{
|
||||
consoleNotifyBox.Visible = true;
|
||||
consoleInputBox.Visible = false;
|
||||
@@ -393,7 +394,7 @@ namespace Cabrito
|
||||
|
||||
public override void OnLineAdded(string text)
|
||||
{
|
||||
int fontHeight = consoleNotifyBox.Font.GetFont().Height;
|
||||
int fontHeight = (int)(consoleNotifyBox.Font.GetFont().Height / Platform.DpiScale);
|
||||
consoleNotifyBox.Height = Math.Min(ConsoleNotifyLines, Console.Lines.Count) * fontHeight;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user