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

Mouse position bug in string diagram editor #90

Closed
epost opened this issue Jan 8, 2019 · 7 comments
Closed

Mouse position bug in string diagram editor #90

epost opened this issue Jan 8, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@epost
Copy link
Member

epost commented Jan 8, 2019

Problem

There seems to be some multiplier >1 at work when moving blocks around in the string diagram editor. When you move the block to the right or down, it moves more than it should.

Steps

I haven't looked into what causes this yet. Any information on work on this would be appreicated.

@epost
Copy link
Member Author

epost commented Jan 8, 2019

@marcosh Maybe you could have a look at this?

@marcosh
Copy link
Contributor

marcosh commented Jan 8, 2019

I had a look at this. The problem is caused by different unit of measurement being used. Somewhere is pixels, somewhere else (the mouse position) is something else. I need to refresh a bit my frontend skills to fix it

@epost
Copy link
Member Author

epost commented Jan 8, 2019

@marcosh Cool, thanks for the research! It might be the scale factor being used here and there. It's not absolutely necessary that you fix this thing btw; this mostly seemed like a good issue to start with qua familiarising yourself with the code.

@marcosh
Copy link
Contributor

marcosh commented Jan 9, 2019

as far as I understood it is not a problem with the code itself. It's just that the unit of measurement in svg is different from the one used in the normal DOM.

Something like what is done in the DOM to SVG Coordinate Translation section here should be done, using FFI to import getScreenCTM() from Javascript.

I could try to do this

@epost
Copy link
Member Author

epost commented Jan 9, 2019

Like we discussed just now, for now let's do the transformation on the js side and pull out the translated coordinates through the FFI, instead of exposing getScreenCTM itself.

@epost
Copy link
Member Author

epost commented Jan 11, 2019

@marcosh
Copy link
Contributor

marcosh commented Jan 11, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants