From d318944185b83cf225e63e368fbefac7236ace57 Mon Sep 17 00:00:00 2001 From: Egor Titov Date: Wed, 22 Jan 2025 18:46:10 +0300 Subject: [PATCH 1/2] fix: use xywh instead of elementBound without rotation --- packages/affine/model/src/elements/brush/brush.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/affine/model/src/elements/brush/brush.ts b/packages/affine/model/src/elements/brush/brush.ts index 94b2edd580e4..06c9f41ac70e 100644 --- a/packages/affine/model/src/elements/brush/brush.ts +++ b/packages/affine/model/src/elements/brush/brush.ts @@ -138,21 +138,19 @@ export class BrushElementModel extends GfxPrimitiveElementModel { instance['_local'].delete('commands'); }) @derive((lineWidth: number, instance: Instance) => { - const oldBound = instance.elementBound; - if ( lineWidth === instance.lineWidth || - oldBound.w === 0 || - oldBound.h === 0 + instance.w === 0 || + instance.h === 0 ) return {}; const points = instance.points; const transformed = transformPointsToNewBound( points.map(([x, y]) => ({ x, y })), - oldBound, + instance, instance.lineWidth / 2, - inflateBound(oldBound, lineWidth - instance.lineWidth), + inflateBound(instance, lineWidth - instance.lineWidth), lineWidth / 2 ); From dde7ea4e48854ceda737dc8432639eaa574d4bbf Mon Sep 17 00:00:00 2001 From: Egor Titov Date: Wed, 22 Jan 2025 18:46:31 +0300 Subject: [PATCH 2/2] chore: update cla.md --- .github/CLA.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CLA.md b/.github/CLA.md index 549256d3a01f..6bb5414d30a3 100644 --- a/.github/CLA.md +++ b/.github/CLA.md @@ -132,3 +132,4 @@ Example: - satoren, @satoren, 2024/08/09 - Nikita Minaev, @majula2111, 2024/09/26 - Oleg, @OlegDev1, 2024/12/03 +- Egor Titov, @EGRoBBeRTiT, 2025/01/22