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(editor): brush xywh do not behave predictably when changing lineWidth of the rotated brush element #9058

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EGRoBBeRTiT
Copy link

This pull request fixes the bug with incorrect calculation xywh of the brush element when changing lineWidth when the element is rotated (see the attached video)

2025-01-22.17.46.00.mov

@EGRoBBeRTiT EGRoBBeRTiT requested a review from a team as a code owner January 22, 2025 15:44
Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: 4dc15ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 3:49pm

Copy link

vercel bot commented Jan 22, 2025

Someone is attempting to deploy a commit to the toeverything Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

graphite-app bot commented Jan 22, 2025

How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

nx-cloud bot commented Jan 22, 2025

View your CI Pipeline Execution ↗ for commit dde7ea4.

Command Status Duration Result
nx vite:build ✅ Succeeded 38s View ↗
nx vite:build @blocksuite/playground ✅ Succeeded 31s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-22 15:53:40 UTC

@EGRoBBeRTiT EGRoBBeRTiT force-pushed the 01-22-fix_uncorrect_brush_xywh_by_linewidth branch from 4dc15ac to dde7ea4 Compare January 22, 2025 15:46
@L-Sun L-Sun changed the title [bug]: brush xywh do not behave predictably when changing lineWidth of the rotated brush element. fix(editor): brush xywh do not behave predictably when changing lineWidth of the rotated brush element Jan 27, 2025
@@ -138,21 +138,19 @@ export class BrushElementModel extends GfxPrimitiveElementModel<BrushProps> {
instance['_local'].delete('commands');
})
@derive((lineWidth: number, instance: Instance) => {
const oldBound = instance.elementBound;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! This change effectively addresses the issue mentioned, but it could be even better by fixing it with just one line of code.

    const oldBound = Bound.fromXYWH(instance.deserializedXYWH);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants