Merge branch 'inputroll-rotatefix'
This commit is contained in:
commit
f7b2982dad
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk.CustomControls
|
namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
{
|
{
|
||||||
public class GdiPlusRenderer : IControlRenderer
|
public class GdiPlusRenderer : IControlRenderer
|
||||||
|
@ -12,6 +12,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
private readonly SolidBrush _currentStringBrush = new SolidBrush(Color.Black);
|
private readonly SolidBrush _currentStringBrush = new SolidBrush(Color.Black);
|
||||||
private readonly Font _defaultFont = new Font("Arial", 8, FontStyle.Bold);
|
private readonly Font _defaultFont = new Font("Arial", 8, FontStyle.Bold);
|
||||||
private Font _currentFont;
|
private Font _currentFont;
|
||||||
|
private bool _rotateString;
|
||||||
|
|
||||||
public GdiPlusRenderer()
|
public GdiPlusRenderer()
|
||||||
{
|
{
|
||||||
|
@ -49,8 +50,18 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawString(string str, Point point)
|
public void DrawString(string str, Point point)
|
||||||
{
|
{
|
||||||
_graphics.DrawString(str, _currentFont, _currentStringBrush, point);
|
if (_rotateString)
|
||||||
|
{
|
||||||
|
_graphics.TranslateTransform(point.X, point.Y);
|
||||||
|
_graphics.RotateTransform(90);
|
||||||
|
_graphics.DrawString(str, _currentFont, _currentStringBrush, Point.Empty);
|
||||||
|
_graphics.ResetTransform();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_graphics.DrawString(str, _currentFont, _currentStringBrush, point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FillRectangle(int x, int y, int w, int h)
|
public void FillRectangle(int x, int y, int w, int h)
|
||||||
|
@ -79,13 +90,9 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
|
|
||||||
public void PrepDrawString(Font font, Color color, bool rotate = false)
|
public void PrepDrawString(Font font, Color color, bool rotate = false)
|
||||||
{
|
{
|
||||||
if (rotate)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentFont = font;
|
_currentFont = font;
|
||||||
_currentStringBrush.Color = color;
|
_currentStringBrush.Color = color;
|
||||||
|
_rotateString = rotate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetBrush(Color color)
|
public void SetBrush(Color color)
|
||||||
|
|
|
@ -199,17 +199,24 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var point = new Point(x + strOffsetX, y + strOffsetY);
|
var point = new Point(x + strOffsetX, y + strOffsetY);
|
||||||
|
|
||||||
var rePrep = false;
|
var rePrep = false;
|
||||||
if (j == 1)
|
//if (j == 1)
|
||||||
if (_selectedItems.Contains(new Cell { Column = visibleColumns[j], RowIndex = i + startRow }))
|
//if (_selectedItems.Contains(new Cell { Column = visibleColumns[j], RowIndex = i + startRow }))
|
||||||
|
//{
|
||||||
|
// _renderer.PrepDrawString(_font, SystemColors.HighlightText, rotate: true);
|
||||||
|
// rePrep = true;
|
||||||
|
//}
|
||||||
|
//else if (j == 1)
|
||||||
|
//{
|
||||||
|
// // 1. not sure about this; 2. repreps may be excess, but if we render one column at a time, we do need to change back after rendering the header
|
||||||
|
// rePrep = true;
|
||||||
|
// _renderer.PrepDrawString(_font, _foreColor, rotate: true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (visibleColumns[j].Type == RollColumn.InputType.Text)
|
||||||
|
if (visibleColumns[j].Name == "FrameColumn")
|
||||||
{
|
{
|
||||||
_renderer.PrepDrawString(_font, SystemColors.HighlightText, rotate: true);
|
|
||||||
rePrep = true;
|
|
||||||
}
|
|
||||||
else if (j == 1)
|
|
||||||
{
|
|
||||||
// 1. not sure about this; 2. repreps may be excess, but if we render one column at a time, we do need to change back after rendering the header
|
|
||||||
rePrep = true;
|
|
||||||
_renderer.PrepDrawString(_font, _foreColor, rotate: true);
|
_renderer.PrepDrawString(_font, _foreColor, rotate: true);
|
||||||
|
rePrep = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawString(text, ColumnWidth, point);
|
DrawString(text, ColumnWidth, point);
|
||||||
|
|
Loading…
Reference in New Issue