Issue #4157Opened February 24, 2022by Adham3800 reactions

BUG: Resizing canvas makes componenents end up with wrong positions once exported with dmode 'absolute'

Question

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

Answers (2)

Adham380February 28, 20220 reactions

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.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.