Skip to content

Commit 1d16925

Browse files
committed
enhance: stop render next inline elements when it is out of bounds
Signed-off-by: leo <[email protected]>
1 parent 8c4362a commit 1d16925

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Views/CommitSubjectPresenter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ public override void Render(DrawingContext context)
9797
return;
9898

9999
var height = Bounds.Height;
100+
var width = Bounds.Width;
100101
foreach (var inline in _inlines)
101102
{
103+
if (inline.X > width)
104+
return;
105+
102106
if (inline.Element is { Type: Models.InlineElementType.Code})
103107
{
104108
var rect = new Rect(inline.X, (height - inline.Text.Height - 2) * 0.5, inline.Text.WidthIncludingTrailingWhitespace + 8, inline.Text.Height + 2);

0 commit comments

Comments
 (0)