Skip to content
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

fix,feat(ui): canvas improvements #7651

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

psychedelicious
Copy link
Collaborator

Summary

  • Fix cursor disappearing when a draw tool is selected and a non-drawable layer (e.g. ref image) is selected. Now it shows the "not-allowed" cursor.
  • Fix an issue where the color picker doesn't work when a non-drawable layer (e.g. ref image) is selected. Now it works.
  • Fix an issue (80% certain) where mask layers didn't render until you jiggle or zoom the canvas.
  • Fix an issue where shift-clicking to draw a line after panning the canvas cuts off the line.
  • Color picker now supports alpha/transparency.
  • Color picker now displays the RGBA value next to it. See video below.
Screen.Recording.2025-02-18.at.2.00.20.pm.mov

Related Issues / Discussions

Offline discussion and scattered discord threads.

QA Instructions

We could add a setting to toggle the RGBA value display, but I ran out of time for that today.

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

- Fix an issue where the cursor disappeared when selecting a non-renderable entity. For example, when selecting a reference image layer and certain tools, the cursor would disappear.
- Ensure color picker works no matter what layer types are selected.

The logic for showing/hiding the cursor needed to be rearranged a bit for this fix.
Unfortunately I couldn't reliably reproduce the issue, so I'm not 100% sure this fixes it. But I think there is a race condition that results in `updateCompositingRectSize` erroneously seeing the layer has no objects and skipping the update.

To address this, the compositing rect fill/size/pos are all now force-updated when the fill/objects are changed. Theoretically it should be impossible for the issue to occur now.
…s moved between clicks

Need to opt-out of the clipping logic when using shift-click to not cut off the line.
- Support transparency w/ color picker. To do this, we need to hide the bg layer before sampling. In testing, this has a negligible performance impact.
- Add an RGBA value readout next to the color picker ring.
@github-actions github-actions bot added the frontend PRs that change frontend files label Feb 18, 2025
@hipsterusername
Copy link
Member

Hallelujah!

@psychedelicious psychedelicious merged commit e1f2b23 into main Feb 18, 2025
15 checks passed
@psychedelicious psychedelicious deleted the psyche/ui/canvas-improvements-papercuts branch February 18, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants