|
@@ -34,6 +34,8 @@ namespace NTERA.Console.RenderItem
|
|
public override int Render(Graphics graphics, Rectangle renderArea, Rectangle invalidatedArea, Point mousePointer)
|
|
public override int Render(Graphics graphics, Rectangle renderArea, Rectangle invalidatedArea, Point mousePointer)
|
|
{
|
|
{
|
|
int x;
|
|
int x;
|
|
|
|
+ float ratio = Image.Width / (float)Image.Height;
|
|
|
|
+ int width = (int)(ratio * renderArea.Height);
|
|
|
|
|
|
switch (Alignment)
|
|
switch (Alignment)
|
|
{
|
|
{
|
|
@@ -42,16 +44,13 @@ namespace NTERA.Console.RenderItem
|
|
x = renderArea.X;
|
|
x = renderArea.X;
|
|
break;
|
|
break;
|
|
case DisplayLineAlignment.CENTER:
|
|
case DisplayLineAlignment.CENTER:
|
|
- x = (renderArea.Width - Image.Width) / 2;
|
|
|
|
|
|
+ x = (renderArea.Width - width) / 2;
|
|
break;
|
|
break;
|
|
case DisplayLineAlignment.RIGHT:
|
|
case DisplayLineAlignment.RIGHT:
|
|
- x = renderArea.Width - Image.Width;
|
|
|
|
|
|
+ x = renderArea.Width - width;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- float ratio = Image.Width / (float)Image.Height;
|
|
|
|
- int width = (int)(ratio * renderArea.Height);
|
|
|
|
-
|
|
|
|
graphics.DrawImage(Image, new Rectangle(x, renderArea.Y, width, renderArea.Height));
|
|
graphics.DrawImage(Image, new Rectangle(x, renderArea.Y, width, renderArea.Height));
|
|
|
|
|
|
return x + width;
|
|
return x + width;
|