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

Calibrate the coordinates based on frame position. #2375

Merged
merged 11 commits into from
Jan 2, 2020

Conversation

emilsedgh
Copy link
Contributor

@emilsedgh emilsedgh commented Nov 4, 2019

Calibrate the coordinates based on frame position.

Since the toolbar lives outside the canvas frame, the event's generated on it
have clientX and clientY relative to the page

This patch makes sure we consider frame offset from the page.

Fixes #2207,#2372

artf and others added 9 commits August 13, 2019 19:09
component.setDragMode('absolute') and then start dragging, you'd get a lot of
`editor is not defined` errors.
Since the toolbar lives outside the canvas frame, the event's generated on it
have clientX and clientY relative to the page. This makes sure we consider
frame offset from the page.

Fixes GrapesJS#2207,GrapesJS#2372
@emilsedgh
Copy link
Contributor Author

@artf Any chance we could review and merge this?

@emilsedgh
Copy link
Contributor Author

I updated the branch to resolve conflicts.

@emilsedgh
Copy link
Contributor Author

Please note that the issue has been reported at least 3 times:
#2207, #2372 and #2473

Copy link
Member

@artf artf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, seems good to me 👍

src/dom_components/view/ToolbarButtonView.js Show resolved Hide resolved
@artf artf changed the base branch from master to dev January 2, 2020 17:09
@artf artf merged commit 50d3a0b into GrapesJS:dev Jan 2, 2020
@artf
Copy link
Member

artf commented Jan 2, 2020

Thanks @emilsedgh ❤️

@ramusesan
Copy link

when can expect to be pushed this changes to npm repo
@artf

@artf
Copy link
Member

artf commented Jan 4, 2020

@ramusesan I'll try to find time to release it tomorrow

@ramusesan
Copy link

@artf ok thanks, I will be waiting

@emilsedgh emilsedgh deleted the issue-2207 branch January 5, 2020 19:08
@alemenciones
Copy link

alemenciones commented Jan 30, 2020

What happens when i change device and the component stay outside of canvas? this's not working maybe

image

@artf
Copy link
Member

artf commented Feb 3, 2020

What happens when i change device and the component stay outside of canvas? this's not working maybe

The outline boxes keep track of the components even outside of their frames

@alemenciones
Copy link

alemenciones commented Feb 3, 2020

The outline boxes keep track of the components even outside of their frames

I'm talking about the calibration of coordinates x/y in the tlb-move event, when the componente is outside of frame, this is not working good

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.

[BUG]: Can't drag component if there is some space on top/left with Mode Absolute
4 participants