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

Several usability improvements, especially for dragging mouse along colors #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Sep 7, 2017

  1. Remove all trailing whitespace

    No functional changes, just removed all whitespace at the end of each
    line.
    soulmerge committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    ea9315a View commit details
    Browse the repository at this point in the history
  2. Register events in enableDragging() only on demand

    The function was previously registering all events and selectively
    performing operations based on a stored state. Changed the behaviour to
    register and unregister relevant event listeners on specific occasions.
    
    This not only removes explicit state, but also grants more flexibility,
    which will be required for future changes.
    soulmerge committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    ebe7274 View commit details
    Browse the repository at this point in the history
  3. Prevent native drag events during custom dragging

    Could not pinpoint why, but sometimes a native drag event triggers while
    sliding the mouse along the palette and suddenly the whole palette is
    being dragged with the mouse.
    
    This commit tries to negate this effect by adding a listener, that
    attempts to prevent the `dragstart` event.
    soulmerge committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    daa804a View commit details
    Browse the repository at this point in the history
  4. Don't stop dragging on mouse leave

    It feels more robust if the dragging continues even if the mouse
    leaves the area that contains the drag listener. This makes it easier to
    pick colors near the edges (particularly near *two* edges, i.e. in the
    corners)
    
    For this to work, another listener had to be altered: the `mouseup`
    listener is now registered on document.body, instead of the drag area.
    It is also unregistered once the dragging is complete.
    soulmerge committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    74b3889 View commit details
    Browse the repository at this point in the history
  5. Further improve dragging outside of target area

    It is now possible to continue dragging along an edge, even if the mouse
    pointer is outside of the target area. This means that dragging along an
    edge or into a corner is now absolutely precise.
    soulmerge committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    a29f322 View commit details
    Browse the repository at this point in the history