src/js/pop.js
branchpopcorn-port
changeset 580 47fb5cd44900
parent 578 8dd6ebb7a79d
child 586 a3705fc7e054
equal deleted inserted replaced
579:179b32df9caa 580:47fb5cd44900
   137   var pos = event.position;
   137   var pos = event.position;
   138   
   138   
   139   var i = 0;
   139   var i = 0;
   140   for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
   140   for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
   141      var c = IriSP.PopcornReplacement.__codes[i];
   141      var c = IriSP.PopcornReplacement.__codes[i];
   142       
   142 
   143      if (pos >= c.start && pos < c.end && 
   143      if (pos >= c.start && pos < c.end && 
   144          pos - 0.1 <= c.start) {       
   144          pos - 1 <= c.start) {       
   145         c.onStart();
   145         c.onStart();
   146      }
   146      }
   147  
   147  
   148      if (pos > c.start && pos > c.end && 
   148      if (pos > c.start && pos > c.end && 
   149          pos - 0.1 <= c.end) {
   149          pos - 1 <= c.end) {
   150          c.onEnd();
   150          c.onEnd();
   151      }
   151      }
   152    
   152    
   153   }
   153   }
   154  
   154  
   163     
   163     
   164      if (event.position >= c.start && event.position < c.end) {        
   164      if (event.position >= c.start && event.position < c.end) {        
   165         c.onEnd();
   165         c.onEnd();
   166      }         
   166      }         
   167    }
   167    }
   168 
   168   
   169    for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
   169    for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
   170      var c = IriSP.PopcornReplacement.__codes[i];
   170      var c = IriSP.PopcornReplacement.__codes[i];
   171 
   171 
   172      if (typeof(event.offset) === "undefined")
   172      if (typeof(event.offset) === "undefined")
   173        event.offset = 0;
   173        event.offset = 0;