TAStudio - calculate row height based on font height

This commit is contained in:
adelikat 2014-07-30 22:46:40 +00:00
parent d89dfd5595
commit e579542b7d
2 changed files with 6 additions and 2 deletions

View File

@ -69,8 +69,8 @@ namespace BizHawk.Client.EmuHawk
break;
}
var headerHeight = 24; //Are these always true? Don't know, is there a way to programmatically determine them?
var rowHeight = 18;
var rowHeight = this.LineHeight + 5; // 5 and 6 work here for me, but are they always dependable, how can I get the padding?
var headerHeight = rowHeight + 6;
newRow = ((y - headerHeight) / rowHeight) + this.VScrollPos;
if (newRow >= ItemCount)

View File

@ -422,6 +422,8 @@ namespace BizHawk.Client.EmuHawk
#endregion
public int LineHeight { get; private set; }
#region Constructors
/// <summary>
@ -441,6 +443,8 @@ namespace BizHawk.Client.EmuHawk
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.Opaque, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
var LineHeight = this.Font.Height + 5;
}
~VirtualListView()