Fix width and height when CSS transform scale is not 1 #19

Closed
xuejian97 wants to merge 1 commit from fix/scale-width into master
xuejian97 commented 2023-09-17 15:52:41 +02:00 (Migrated from github.com)
No description provided.
marijnh commented 2023-09-20 17:26:59 +02:00 (Migrated from github.com)

You seem to just be largely reverting the code to your patch here. What exactly is the problem this is supposed to solve? If you want the cursor with to scale along with the transform, just removing the division by the scale from halfWidth/halfHeight should be enough.

You seem to just be largely reverting the code to your patch here. What exactly is the problem this is supposed to solve? If you want the cursor with to scale along with the transform, just removing the division by the scale from halfWidth/halfHeight should be enough.
xuejian97 commented 2023-09-21 18:43:06 +02:00 (Migrated from github.com)

You seem to just be largely reverting the code to your patch here. What exactly is the problem this is supposed to solve? If you want the cursor with to scale along with the transform, just removing the division by the scale from halfWidth/halfHeight should be enough.

Because patch af2c980 has a drop cursor width bug, which is easier to find when the width of the cursor is large and the scale is small, e.g. drop cursor width = 10 and scale = 0.5, then the width of the cursor is calculated as 40px. the same problem exists with the height.

I was trying to fix the width bug on top of patch, but it didn't work or caused a new bug, so in this PR I just kept the patch code that automatically calculates the scale value and reverted the rest of the code back to my modification, which works correctly.

I tried just removing the division by the scale from halfWidth/halfHeight doesn't seem to fix the problem either. I found another similar solution though in PR https://github.com/ProseMirror/prosemirror-dropcursor/pull/20. Please check it out, thanks a lot!

> You seem to just be largely reverting the code to your patch here. What exactly is the problem this is supposed to solve? If you want the cursor with to scale along with the transform, just removing the division by the scale from halfWidth/halfHeight should be enough. Because patch [af2c980](https://github.com/ProseMirror/prosemirror-dropcursor/commit/af2c980cc2e531a33de2354eeb1730c5dbf2461a) has a drop cursor width bug, which is easier to find when the width of the cursor is large and the scale is small, e.g. drop cursor width = 10 and scale = 0.5, then the width of the cursor is calculated as 40px. the same problem exists with the height. I was trying to fix the width bug on top of patch, but it didn't work or caused a new bug, so in this PR I just kept the patch code that automatically calculates the scale value and reverted the rest of the code back to my modification, which works correctly. I tried just removing the division by the scale from halfWidth/halfHeight doesn't seem to fix the problem either. I found another similar solution though in PR https://github.com/ProseMirror/prosemirror-dropcursor/pull/20. Please check it out, thanks a lot!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-dropcursor!19
No description provided.