Changeset 1555


Ignore:
Timestamp:
05/10/21 11:11:48 (3 years ago)
Author:
davidb
Message:

Merging in minor tweaks from the mozart's laptop branch of the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/apollo/AudioFrameMouseActions.java

    r1102 r1555  
    3030public class AudioFrameMouseActions implements MouseMotionListener, MouseListener {
    3131       
    32         private static final int COARSE_X_PLACEMENT_TOLERANCE = 80; // The minium distance from a track widet to auto-align free space items to
     32        private static final int COARSE_X_PLACEMENT_TOLERANCE = 80; // The minimum distance from a track widget to auto-align free space items to
    3333
    3434        private static final int COARSE_Y_PLACEMENT_TOLERANCE = 20;
     
    3939        private static List<Item> anchoringItems = new LinkedList<Item>();
    4040
     41        protected static boolean hasTimeline()
     42        {
     43                return FrameLayoutDaemon.inferCurrentTotalMSTime()>0;
     44        }
     45   
    4146        public void mouseDragged(MouseEvent e) {
    4247                FrameMouseActions.getInstance().mouseDragged(e);
     
    155160                }
    156161               
    157                 // Expeditees frame mouse actions uses an offset and fights over free-item
     162                // Expeditee's frame mouse actions uses an offset and fights over free-item
    158163                // movement if it listens to the mouse event router... therefore add an extra
    159164                // layer to avoid this... otherwise auto-aligned items jitter like crazy while
     
    179184
    180185        public void mousePressed(MouseEvent e) {
    181                 isAnchoring = (e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) != 0;
    182                 isStamping = (e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) != 0;
     186                if (hasTimeline()) {
     187                        isAnchoring = (e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) != 0;
     188                        isStamping = (e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) != 0;
     189                }
     190
    183191                FrameMouseActions.getInstance().mousePressed(e);
    184192        }
     
    303311         */
    304312        public static boolean isYAxisRestictionOn() {
    305                 return AudioFrameKeyboardActions.isControlDown && !AudioFrameKeyboardActions.isShiftDown;
     313                if (!hasTimeline()) {
     314                        return false;
     315                }
     316                else {
     317                        return AudioFrameKeyboardActions.isControlDown && !AudioFrameKeyboardActions.isShiftDown;
     318                }
    306319        }
    307320       
    308321        public static boolean isSnapOn() {
    309                 return AudioFrameKeyboardActions.isShiftDown && !AudioFrameKeyboardActions.isControlDown;
     322                if (!hasTimeline()) {
     323                        return false;
     324                }
     325                else {
     326                        return AudioFrameKeyboardActions.isShiftDown && !AudioFrameKeyboardActions.isControlDown;
     327                }
    310328        }
    311329       
Note: See TracChangeset for help on using the changeset viewer.