IControlRenderer - Simplify API
This commit is contained in:
parent
cb9b28514c
commit
230cc676c3
|
@ -40,11 +40,9 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
|||
_graphics.DrawImage(bitmap, point);
|
||||
}
|
||||
|
||||
public void DrawRectangle(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)
|
||||
public void DrawRectangle(Rectangle rect)
|
||||
{
|
||||
_graphics.DrawRectangle(
|
||||
_currentPen,
|
||||
new Rectangle(nLeftRect, nTopRect, nRightRect - nLeftRect, nBottomRect - nTopRect));
|
||||
_graphics.DrawRectangle(_currentPen, rect);
|
||||
}
|
||||
|
||||
public void DrawString(string str, Rectangle rect)
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
|||
/// </summary>
|
||||
void DrawString(string str, Rectangle rect);
|
||||
|
||||
void DrawRectangle(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
|
||||
void DrawRectangle(Rectangle rect);
|
||||
void FillRectangle(int x, int y, int w, int h);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -105,10 +105,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
columnWidth = ColumnWidth;
|
||||
columnHeight = GetHColHeight(columnIndex);
|
||||
}
|
||||
|
||||
int x1 = _currentX.Value - (columnWidth / 2);
|
||||
int y1 = _currentY.Value - (columnHeight / 2);
|
||||
int x2 = x1 + columnWidth;
|
||||
int y2 = y1 + columnHeight;
|
||||
int textOffsetY = CellHeightPadding;
|
||||
if (HorizontalOrientation)
|
||||
{
|
||||
|
@ -117,7 +116,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
_renderer.SetSolidPen(_backColor);
|
||||
_renderer.DrawRectangle(x1, y1, x2, y2);
|
||||
_renderer.DrawRectangle(new Rectangle(x1, y1, columnWidth, columnHeight));
|
||||
_renderer.PrepDrawString(Font, _foreColor);
|
||||
_renderer.DrawString(_columnDown.Text, new Rectangle(x1 + CellWidthPadding, y1 + textOffsetY, columnWidth, columnHeight));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue