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

Add key mapping for quick action (basic js, svg.js ) related to moving shape #34

Closed
amitguptagwl opened this issue Jun 8, 2018 · 9 comments
Labels
enhancement This issue add some new features to this application. first-timers-only Suitable for fevelopers who are contributing first time in open source development . good first issue help wanted

Comments

@amitguptagwl
Copy link
Member

amitguptagwl commented Jun 8, 2018

Demo: https://naturalintelligence.github.io/imglab/

workarea.tag.html

  • Ctrl + arrow key: to move a selected shape(s) by 1 pix

Hint code:

if(up) diffY = -1
if(down) diffY = 1
if(left) diffX = -1
if(right) diffX = 1

selectedShapes.forEach(shape => { 
   shape.move(shape.rbox.x + diffX ,shape.rbox.y + diffY) ;
}

Note - all the new key mappings need to be mentioned in shortcuts.tag.html

Check technical documentation.

@amitguptagwl amitguptagwl added enhancement This issue add some new features to this application. help wanted good first issue first-timers-only Suitable for fevelopers who are contributing first time in open source development . labels Jun 8, 2018
@devamaz
Copy link

devamaz commented Jun 9, 2018

Will love to work on this

@amitguptagwl
Copy link
Member Author

Please go on. I hope, it'll not take much time.

@devamaz
Copy link

devamaz commented Jun 12, 2018

Sorry man didn't check my feeds will work on it today

@devamaz
Copy link

devamaz commented Jun 12, 2018

Hy need some help with the selectedShapes they are the selectedElement right? @amitguptagwl

@amitguptagwl
Copy link
Member Author

if you mean by variable name it should be selectedElements

@devamaz
Copy link

devamaz commented Jun 12, 2018

ok Thanks

@devamaz
Copy link

devamaz commented Jun 13, 2018

Sorry can't continue with this if another person can take

@amitguptagwl
Copy link
Member Author

no problem

@amitguptagwl
Copy link
Member Author

Snippet for reference

selectedElements.forEach(el => {
    el.parent().dy(-1);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue add some new features to this application. first-timers-only Suitable for fevelopers who are contributing first time in open source development . good first issue help wanted
Projects
None yet
Development

No branches or pull requests

2 participants