Skip to content

Commit

Permalink
fix(Studio): Wrapped comment rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Oct 27, 2024
1 parent a5ea289 commit 5136887
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3660,7 +3660,7 @@ protected override void Draw(PaintEventArgs e, SKSurface surface, SKImageInfo im
var subLine = wrap.Lines[i].Line;
float xIdent = i == 0 ? 0 : wrap.StartOffset * Font.CharWidth();

canvas.DrawText(subLine, textOffsetX + xIdent, yPos, Font, Settings.Instance.Theme.CommentPaint.ForegroundColor);
canvas.DrawText(subLine, textOffsetX + xIdent, yPos + Font.Offset(), Font, Settings.Instance.Theme.CommentPaint.ForegroundColor);
yPos += Font.LineHeight();
width = Math.Max(width, Font.MeasureWidth(subLine) + xIdent);
height += Font.LineHeight();
Expand Down Expand Up @@ -3688,7 +3688,7 @@ protected override void Draw(PaintEventArgs e, SKSurface surface, SKImageInfo im
var subLine = wrap.Lines[i].Line;
float xIdent = i == 0 ? 0 : wrap.StartOffset * Font.CharWidth();

canvas.DrawText(subLine, textOffsetX + xIdent, yPos, Font, Settings.Instance.Theme.CommentPaint.ForegroundColor);
canvas.DrawText(subLine, textOffsetX + xIdent, yPos + Font.Offset(), Font, Settings.Instance.Theme.CommentPaint.ForegroundColor);
yPos += Font.LineHeight();
}
} else {
Expand Down Expand Up @@ -3818,7 +3818,7 @@ protected override void Draw(PaintEventArgs e, SKSurface surface, SKImageInfo im
fillPaint.ColorF = Settings.Instance.Theme.CalculateBg.ToSkia();
canvas.DrawRoundRect(x, y, w, h, 4.0f, 4.0f, fillPaint);
fillPaint.ColorF = Settings.Instance.Theme.CalculateFg.ToSkia();
canvas.DrawText(calculateLine, x + padding, y+ Font.Offset(), Font, fillPaint);
canvas.DrawText(calculateLine, x + padding, y + Font.Offset(), Font, fillPaint);
}

// Draw line numbers
Expand Down Expand Up @@ -3882,10 +3882,10 @@ protected override void Draw(PaintEventArgs e, SKSurface surface, SKImageInfo im
}

if (Settings.Instance.LineNumberAlignment == LineNumberAlignment.Left) {
canvas.DrawText(numberString, scrollablePosition.X + LineNumberPadding, yPos+ Font.Offset(), Font, fillPaint);
canvas.DrawText(numberString, scrollablePosition.X + LineNumberPadding, yPos + Font.Offset(), Font, fillPaint);
} else if (Settings.Instance.LineNumberAlignment == LineNumberAlignment.Right) {
float ident = Font.CharWidth() * (Document.Lines.Count.Digits() - (row + 1).Digits());
canvas.DrawText(numberString, scrollablePosition.X + LineNumberPadding + ident, yPos+ Font.Offset(), Font, fillPaint);
canvas.DrawText(numberString, scrollablePosition.X + LineNumberPadding + ident, yPos + Font.Offset(), Font, fillPaint);
}

bool collapsed = false;
Expand Down

0 comments on commit 5136887

Please sign in to comment.