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: Apply correct translation when text editor overflows when zoom not 100% #3225

Merged
merged 4 commits into from Mar 11, 2021

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented Mar 11, 2021

Attempt to fix #3220

@vercel
Copy link

vercel bot commented Mar 11, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/DckLbnbPf7Hq6ReoHaNBehAXmc1r
✅ Preview: https://excalidraw-git-aakansha-trans-excalidraw.vercel.app

@ad1992 ad1992 changed the title fix: Apply correct translation when zoom not 100% fix: Apply correct translation when text editor overflows when zoom not 100% Mar 11, 2021
@dwelle
Copy link
Member

dwelle commented Mar 11, 2021

The wysiwyg jumps when zoomed in:

excal_wysiwyg_border_jump

Moreoever, it doesn't work with rotated text (both in this PR & prod):

image

So maybe instead of hacking it further, maybe we should do the "nest inside + relative positioning" after all (though it will simply cut off the wysiwyg if it works out).

@ad1992
Copy link
Member Author

ad1992 commented Mar 11, 2021

The wysiwyg jumps when zoomed in:

excal_wysiwyg_border_jump

This should be fixed now

Moreoever, it doesn't work with rotated text (both in this PR & prod):

image

So maybe instead of hacking it further, maybe we should do the "nest inside + relative positioning" after all (though it will simply cut off the wysiwyg if it works out).

Are you talking about positioning relative to .excalidraw ? That would also not work right since it will then be positioned relative to its actual position and excalidraw takes the whole width/height thats why had made it position absolute.

I have only updated the translateX value in this pr to fix overflow when zoom is not 100%, the rotation issue should also be fixable with position absolute I think given some time. If this fix looks good for overflow then we can merge it.

src/element/textWysiwyg.tsx Outdated Show resolved Hide resolved
@dwelle
Copy link
Member

dwelle commented Mar 11, 2021

That would also not work right since it will then be positioned relative to its actual position and excalidraw takes the whole width/height thats why had made it position absolute.

Unclear what you mean by "positioned relative to its actual position".

Anyway, we can merge.

@ad1992 ad1992 marked this pull request as ready for review March 11, 2021 21:00
@ad1992 ad1992 merged commit 3780a15 into master Mar 11, 2021
@ad1992 ad1992 deleted the aakansha-trans branch March 11, 2021 21:08
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

Successfully merging this pull request may close these issues.

Text editor shifts when zoom level is not 100%
2 participants