Comfy-Org / Comfy-Org/ComfyUI_frontend

Audit and cleanup CanvasRenderingContext2D usage to ensure .save()/.restore() pattern

Open
#9,021 0 comments 0 reactions 4 assignees Claimed by @AustinMroz View on GitHub
area:ui
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Background

As discussed in PR #8992, all uses of `CanvasRenderingContext2D` should follow the pattern of calling `.save()` at the beginning and `.restore()` at the end to properly manage canvas state.

## Task

Audit the codebase to find all existing uses of `CanvasRenderingContext2D` and ensure they properly use the `.save()` and `.restore()` pattern to prevent state leakage.

## References

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8992
- Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8992#discussion_r2835103633
- Requested by: @DrJKL

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9021-Audit-and-cleanup-CanvasRenderingContext2D-usage-to-ensure-save-restore-pattern-30d6d73d36508188a2b9c941729ba9dc) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.