Changeset 78

Show
Ignore:
Timestamp:
07/30/08 21:16:42 (4 months ago)
Author:
bi..@lilyapp.org
Message:

fix a selection/deselection bug in the paste code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/patch.js

    r77 r78  
    892892                                        } 
    893893                                         
    894                                         if(opID) { 
     894                                        if(opID && !this.patchController.isMouseDown) { 
    895895                                                o.controller.select({type:"paste"}); //if we're pasting, select the object after we create it. 
    896896                                        } 
     
    906906                                        } 
    907907                                         
    908                                         if(opID) { 
     908                                        if(opID && !this.patchController.isMouseDown) { 
    909909                                                c.controller.select({type:"paste"}); 
    910910                                        }                                                
     
    10141014        this.paste=function() { 
    10151015                if(Lily.clipboard) { 
     1016                        if(!thisPtr.patchController.isMouseDown)thisPtr.patchController.deselectAll() 
    10161017                        var id=this.generateUID(); //new id 
    1017                         this.openPatch(Lily.clipboard,id); 
     1018                        thisPtr.openPatch(Lily.clipboard,id); 
    10181019                        thisPtr.patchController.notifyPatchListeners("patchModified"); 
    10191020                }                        
     
    12191220        this.mouseY=0; 
    12201221        var mouseDownTime=new Date(); //init 
     1222        this.isMouseDown=false; //flag to tell if mouse is down.         
    12211223         
    12221224        this.editable="edit"; 
     
    18341836                thisPtr.mouseX=e.clientX; 
    18351837                thisPtr.mouseY=e.clientY; 
    1836                 mouseDownTime=new Date();                
     1838                mouseDownTime=new Date(); 
     1839                thisPtr.isMouseDown=true;                
    18371840        } 
    18381841         
     
    18491852                var mouseUpTime=new Date(); 
    18501853                var diff=mouseUpTime.getTime()-mouseDownTime.getTime(); 
     1854                thisPtr.isMouseDown=false;               
    18511855                if(diff>300) { 
    18521856                        okToCreate=false;