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] In absolute dragmode the components are not dropped properly if zoom is applied #2423

Closed
MartinPutz opened this issue Nov 23, 2019 · 2 comments

Comments

@MartinPutz
Copy link

Components are not dropped to the exact position if dragmode set to absolute and there is a zoom value applied on the canvas.

GrapesJS version:0.15.8

The issue can be reproduced in the demo as well:
https://jsfiddle.net/y8m1x4a3/

Expected behavior:
Components can be dropped to the cursor position even if the dragmode is set to absolute and a zoom is applied on the canvas.

Current behavior:
When dragmode is absolute and there is a zoom value, the components are dropped away from the cursor position. (the distance/offset depends on the zoom level)

Steps to reproduce:

  1. Open jsfiddle above (with editor.Canvas.setZoom(50))
  2. Try to add a new text component
  3. Check the distance between the cursor position and the component's position.

The distance/offset depends on the zoom value.

The editor.Canvas.setZoom function uses a transform:scale() CSS property and then the 'drop' position is not accurate anymore.

@artf
Copy link
Member

artf commented Nov 26, 2019

Should be fixed in this branch https://github.com/artf/grapesjs/tree/multi-frame
Multi framing is still far from being complete but I hope to merge soon that branch (big canvas refactoring but without breaking changes), definitely not for this release (should be published this days) but probably in the next one.

@artf
Copy link
Member

artf commented Oct 16, 2021

I close this issue as I'm planning to solve all ones related to absolute positioning here: #3770

@artf artf closed this as completed Oct 16, 2021
@GrapesJS GrapesJS locked and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants