Skip to content

fix: highlight border to be drawn many times in different places in the frozen area #1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function drawHighlightRings(
) {
const wasDashed: boolean = dashed;
const needsClip = !rectContains(s.clip, s.rect);
ctx.beginPath();
Copy link
Preview

Copilot AI Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ctx.beginPath() and the later call to ctx.closePath() does not affect the strokeRect call since strokeRect creates its own path. If the intention is to limit the drawing to a specific clipping region, consider calling ctx.clip() after setting the clip rectangle.

Suggested change
ctx.beginPath();
// Begin path is unnecessary for strokeRect as it creates its own path

Copilot uses AI. Check for mistakes.

if (needsClip) {
ctx.save();
ctx.rect(s.clip.x, s.clip.y, s.clip.width, s.clip.height);
Expand All @@ -133,6 +134,7 @@ export function drawHighlightRings(
s.style === "solid-outline"
? blend(blend(s.color, theme.borderColor), theme.bgCell)
: withAlpha(s.color, 1);
ctx.closePath();
ctx.strokeRect(s.rect.x + 0.5, s.rect.y + 0.5, s.rect.width - 1, s.rect.height - 1);
if (needsClip) {
ctx.restore();
Expand Down