Changeset - 4bd88d5fcaf8
[Not reviewed]
default
0 1 0
Drew Perttula - 7 years ago 2018-06-07 17:39:41
drewp@bigasterisk.com
don't let mouse start outside large colorpick so much
Ignore-this: ac2fed0d6f9f2056092d292e6eb3ff97
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/web/light9-color-picker.html
Show inline comments
 
@@ -275,50 +275,50 @@
 
       this.hueSatColor = one.color(color).value(1).hex();
 

	
 
       this._updateSmallCrosshair();
 
       this.pauseWrites = false;
 
     }
 
     _updateSmallCrosshair() {
 
       try {
 
         var pos = this.small.posFor(this.color);
 
       } catch(e) {
 
         this.moveSmallCrosshair([-999, -999]);
 
         return;
 
       }
 
       this.moveSmallCrosshair(pos);
 
     }
 
     showLarge(x, y) {
 
       this.$.large.style.display = 'block';
 
       try {
 
         let pos;
 
         try {
 
           pos = this.large.posFor(this.color);
 
         } catch(e) {
 
           pos = [-999, -999];
 
         }
 
         this.moveLargeCrosshair(pos);
 
         this.$.large.style.left = (x - Math.max(20, Math.min(380, pos[0]))) + 'px';
 
         this.$.large.style.top = (y - Math.max(20, Math.min(180, pos[1]))) + 'px';
 
         this.$.large.style.left = (x - Math.max(60, Math.min(380, pos[0]))) + 'px';
 
         this.$.large.style.top = (y - Math.max(60, Math.min(180, pos[1]))) + 'px';
 
       } catch(e) {
 
         this.moveLargeCrosshair([-999, -999]);
 
         this.$.large.style.left = (400 / 2) + 'px';
 
         this.$.large.style.top = (200 / 2) + 'px';
 
         return;
 
       }
 
     }
 
     hideLarge() {
 
       this.$.large.style.display = 'none';
 
       if (this.color !== undefined) {
 
         this.readColor(this.color);
 
       }
 
       this.closeTime = Date.now();
 
     }
 
     onEnterSmall(ev) {
 
       if (this.closeTime && this.closeTime > Date.now() - 500) {
 
         return;
 
       }
 

	
 
       // if scrolling put us here, don't open large. require deliberate entering motion.
 
       
 
       this.showLarge(ev.pageX, ev.pageY);
 
     }
 
     moveLargeCrosshair(pos, _elem) {
0 comments (0 inline, 0 general)