mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Make sure to round line spacing.
This commit is contained in:
parent
12a87caa65
commit
83b37239b7
3 changed files with 9 additions and 8 deletions
|
@ -105,7 +105,7 @@ namespace Beefy.theme.dark
|
|||
mLineCoords.GrowUninitialized(mData.mLineStarts.Count);
|
||||
mLineCoordJumpTable.Clear();
|
||||
|
||||
float fontHeight = mFont.GetLineSpacing() * mLineHeight;
|
||||
float fontHeight = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
int prevJumpIdx = -1;
|
||||
float jumpCoordSpacing = GetJumpCoordSpacing();
|
||||
|
||||
|
@ -218,7 +218,7 @@ namespace Beefy.theme.dark
|
|||
public float GetTextOffset()
|
||||
{
|
||||
float baseLineSpacing = mFont.GetLineSpacing();
|
||||
float lineSpacing = mFont.GetLineSpacing() * mLineHeight;
|
||||
float lineSpacing = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
return lineSpacing / 2.0f - baseLineSpacing / 2.0f;
|
||||
}
|
||||
|
||||
|
@ -534,7 +534,7 @@ namespace Beefy.theme.dark
|
|||
|
||||
#unwarn
|
||||
int lineCount = GetLineCount();
|
||||
float lineSpacing = mFont.GetLineSpacing() * mLineHeight;
|
||||
float lineSpacing = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
float fontLineSpacing = mFont.GetLineSpacing();
|
||||
float textYOffset = GetTextOffset();
|
||||
|
||||
|
|
|
@ -1212,11 +1212,12 @@ namespace IDE.ui
|
|||
if ((flags & ~(uint8)SourceElementFlags.Skipped) == 0)
|
||||
return;
|
||||
|
||||
let lineSpacing = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
if ((flags & (uint8)SourceElementFlags.SymbolReference) != 0)
|
||||
{
|
||||
bool isRenameSymbol = (IDEApp.sApp.mSymbolReferenceHelper != null) && (IDEApp.sApp.mSymbolReferenceHelper.mKind == SymbolReferenceHelper.Kind.Rename);
|
||||
using (g.PushColor(isRenameSymbol ? (uint32)0x28FFFFFF : (uint32)0x18FFFFFF))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing() * mLineHeight);
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.SymbolReference));
|
||||
return;
|
||||
|
@ -1225,7 +1226,7 @@ namespace IDE.ui
|
|||
if ((flags & (uint8)SourceElementFlags.Find_CurrentSelection) != 0)
|
||||
{
|
||||
using (g.PushColor(0x504C575C))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing() * mLineHeight);
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)(SourceElementFlags.Find_CurrentSelection | .Find_Matches)));
|
||||
return;
|
||||
|
@ -1234,7 +1235,7 @@ namespace IDE.ui
|
|||
if ((flags & (uint8)SourceElementFlags.Find_Matches) != 0)
|
||||
{
|
||||
using (g.PushColor(0x50D0C090))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing() * mLineHeight);
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.Find_Matches));
|
||||
return;
|
||||
|
@ -5852,7 +5853,7 @@ namespace IDE.ui
|
|||
}
|
||||
orderedEmitEmbeds.Sort(scope (lhs, rhs) => lhs.line <=> rhs.line);
|
||||
|
||||
float fontHeight = mFont.GetLineSpacing() * mLineHeight;
|
||||
float fontHeight = Math.Round(mFont.GetLineSpacing() * mLineHeight);
|
||||
int prevJumpIdx = -1;
|
||||
float jumpCoordSpacing = GetJumpCoordSpacing();
|
||||
|
||||
|
|
|
@ -4550,7 +4550,7 @@ namespace IDE.ui
|
|||
{
|
||||
float editX = GetEditX();
|
||||
|
||||
float lineSpacing = ewc.mFont.GetLineSpacing() * ewc.mLineHeight;
|
||||
float lineSpacing = Math.Round(ewc.mFont.GetLineSpacing() * ewc.mLineHeight);
|
||||
int cursorLineNumber = mEditWidget.mEditWidgetContent.CursorLineAndColumn.mLine;
|
||||
bool hiliteCurrentLine = mEditWidget.mHasFocus;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue