mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Tweaks to Line Height Scale
This commit is contained in:
parent
4ada557f64
commit
de7ec27032
6 changed files with 22 additions and 15 deletions
|
@ -50,7 +50,7 @@ namespace Beefy.theme.dark
|
|||
}
|
||||
|
||||
public Font mFont;
|
||||
public float mLineHeight = 1.0f;
|
||||
public float mLineHeightScale = 1.0f;
|
||||
public uint32[] mTextColors = sDefaultColors;
|
||||
public uint32 mHiliteColor = 0xFF2f5c88;
|
||||
public uint32 mUnfocusedHiliteColor = 0x00000000;
|
||||
|
@ -69,6 +69,8 @@ namespace Beefy.theme.dark
|
|||
|
||||
protected static uint32[] sDefaultColors = new uint32[] ( Color.White ) ~ delete _;
|
||||
|
||||
public float LineHeight => Math.Max(Math.Round(mFont.GetLineSpacing() * mLineHeightScale), 1);
|
||||
|
||||
public this(EditWidgetContent refContent = null) : base(refContent)
|
||||
{
|
||||
//mTextInsets.Set(-3, 2, 0, 2);
|
||||
|
@ -105,7 +107,7 @@ namespace Beefy.theme.dark
|
|||
mLineCoords.GrowUninitialized(mData.mLineStarts.Count);
|
||||
mLineCoordJumpTable.Clear();
|
||||
|
||||
float fontHeight = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
float fontHeight = LineHeight;
|
||||
int prevJumpIdx = -1;
|
||||
float jumpCoordSpacing = GetJumpCoordSpacing();
|
||||
|
||||
|
@ -218,7 +220,7 @@ namespace Beefy.theme.dark
|
|||
public float GetTextOffset()
|
||||
{
|
||||
float baseLineSpacing = mFont.GetLineSpacing();
|
||||
float lineSpacing = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
float lineSpacing = LineHeight;
|
||||
return lineSpacing / 2.0f - baseLineSpacing / 2.0f;
|
||||
}
|
||||
|
||||
|
@ -534,7 +536,7 @@ namespace Beefy.theme.dark
|
|||
|
||||
#unwarn
|
||||
int lineCount = GetLineCount();
|
||||
float lineSpacing = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
float lineSpacing = LineHeight;
|
||||
float fontLineSpacing = mFont.GetLineSpacing();
|
||||
float textYOffset = GetTextOffset();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue