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

[Bug]: Textbox rounds width when resizing, very obvious when zoomed in. #10180

Open
7 tasks done
Soldier-B opened this issue Sep 26, 2024 · 2 comments
Open
7 tasks done

Comments

@Soldier-B
Copy link

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

6.0.2

In What environments are you experiencing the problem?

No response

Node Version (if applicable)

None

Link To Reproduction

https://codesandbox.io/p/devbox/fabric-vanillajs-sandbox-forked-tld2gt

Steps To Reproduce

  1. Create a canvas
  2. Add an instance of Textbox to the canvas
  3. Zoom in to canvas
  4. Resize textbox with horizontal sizing controls

Expected Behavior

The textbox should resize smoothly as it does when using the vertical sizing controls.

Actual Behavior

The textbox seems to round it's width, so there is a noticeable "snapping" effect when resizing while zoomed in.

Error Message & Stack Trace

No response

@Soldier-B Soldier-B changed the title [Bug]: Textbox rounds with when resizing, very obvious when zoomed in. [Bug]: Textbox rounds width when resizing, very obvious when zoomed in. Sep 26, 2024
@asturur
Copy link
Member

asturur commented Sep 27, 2024

      newWidth = Math.ceil(
        Math.abs((localPoint.x * multiplier) / target.scaleX) - strokePadding,
      );

There is Math.ceil there indeed.
I m not sure why to be honest, you could try to open a PR to remove it and we can see what happens.

@Soldier-B
Copy link
Author

@asturur Ok, thank you. I'll do that.

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

No branches or pull requests

2 participants