croptool icon indicating copy to clipboard operation
croptool copied to clipboard

allow user to hold shift while cropping to crop proportionally

Open jaredzimmerman opened this issue 11 years ago • 2 comments

shift for advanced, users and perhaps a checkbox that is more visible for user who aren't familiar with this convention in graphics applications

jaredzimmerman avatar Nov 12 '14 21:11 jaredzimmerman

Agree that would be nice to have

danmichaelo avatar Nov 13 '14 16:11 danmichaelo

Had a quick look at this, and it doesn't seem straightforward to implement.

We could listen to keydown and keyup (like suggested in https://github.com/tapmodo/Jcrop/pull/18), but there's two problems:

  • If JCrop has focus, JCrop will eat the shift keydown event itself, so it won't bubble down.
  • We will only be able to catch the keydown event when the window has focus. The user might very well press down the shift key while focus is on something else.
    • The best way to check if shift key is pressed is probably to check the event.shiftKey property on the mousedown event. But then we need a layer in front of JCrop to handle this event before letting it bubble down to JCrop. But that seems quite hard to implement in a somewhat clean way without modifying JCrop.

danmichaelo avatar Sep 20 '15 19:09 danmichaelo