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: Resizing canvas makes componenents end up with wrong positions once exported with dmode 'absolute' #4157

Closed
2 tasks done
Adham380 opened this issue Feb 24, 2022 · 2 comments

Comments

@Adham380
Copy link

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Microsoft edge 98.0.1108.56

Reproducible demo link

https://jsfiddle.net/473b2tah/1/

Describe the bug

The canvas resize is cool but does not take into account that one might be working with px offsets because of dmode which works with px offsets, meaning, the zoomed in canvas, does not reflect the exported index.html page. The entire right side is empty once exported because the images are never told to rescale to fit the exported version. So for example here the canvas is at 0.85 scaling, which means the images should be scaled up by 1.15 and all moved to the right accordingly but are instead stuck on the left, leaving a gap on the right of about 15%. The canvas size should be about 1632 pixels, meanwhile the export width is 15% higher, aka 1920. This is something that I think should be automated and should be fairly simple to implement...

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Adham380
Copy link
Author

I have sort of found a workaround...
Set the .gjs-frame-wrapper to the desired width in CSS and transform: translate (- x px, 0px) for the iframe in CSS. The Canvas is not the correct width then (slightly smaller) but everything seems to work fine nonetheless... I am not going to close the issue however, due to the fact, that it's due to the poor implementation of the author, who could fix this extremely easily, as outlined before.

@artf
Copy link
Member

artf commented Mar 7, 2022

#3770 (comment)

@artf artf closed this as completed Mar 7, 2022
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