Changeset 11223 in josm


Ignore:
Timestamp:
2016-11-06T20:18:38+01:00 (6 months ago)
Author:
simon04
Message:

fix #13703 - Fine tune mouse wheel action on layer visibility sliders

  • Invert slider movement wrt. scroll direction
  • Scroll up on hidden layer makes it visible
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java

    r11206 r11223  
    204204                return;
    205205            }
    206             double rotation = e.getPreciseWheelRotation();
     206            double rotation = -1 * e.getPreciseWheelRotation();
    207207            double destinationValue = getValue() + rotation * SLIDER_WHEEL_INCREMENT;
    208208            if (rotation < 0) {
     
    282282        @Override
    283283        protected void mouseWheelMoved(MouseWheelEvent e) {
    284             if (!isEnabled() && !filterLayers(model.getSelectedLayers()).isEmpty() && e.getPreciseWheelRotation() > 0) {
     284            if (!isEnabled() && !filterLayers(model.getSelectedLayers()).isEmpty() && e.getPreciseWheelRotation() < 0) {
    285285                // make layer visible and set the value.
    286286                // this allows users to use the mouse wheel to make the layer visible if it was hidden previously.
    287287                e.consume();
    288288                setVisibleFlag(true);
    289                 setRealValue(0.05);
    290289            } else {
    291290                super.mouseWheelMoved(e);
Note: See TracChangeset for help on using the changeset viewer.