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

Conversation

starlight-93
Copy link
Contributor

image

There are multiple cropping regions, resulting in the border not being cropped

@starlight-93 starlight-93 changed the title fix: highlight border to be drawn multiple times fix: highlight border to be drawn many times in different places in the frozen area Nov 13, 2024
@starlight-93 starlight-93 marked this pull request as draft November 14, 2024 03:19
@starlight-93 starlight-93 marked this pull request as ready for review November 14, 2024 03:20
@lukasmasuch lukasmasuch requested a review from Copilot June 16, 2025 23:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where highlight borders are drawn improperly due to multiple cropping regions in frozen areas.

  • Introduces calls to ctx.beginPath() and ctx.closePath() for handling the clipping region.
  • Aims to address the border rendering by modifying the canvas drawing behavior.

@@ -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.

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@lukasmasuch lukasmasuch merged commit a436d5d into glideapps:main Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants