diff --git a/petitnote/app/chickenpaint/js/chickenpaint.js b/petitnote/app/chickenpaint/js/chickenpaint.js index 7b0e3200..079a6fa8 100644 --- a/petitnote/app/chickenpaint/js/chickenpaint.js +++ b/petitnote/app/chickenpaint/js/chickenpaint.js @@ -19168,7 +19168,7 @@ function CPCanvas(controller) { CPDrawingMode.prototype.suspend = CPDrawingMode.prototype.leave; CPDrawingMode.prototype.resume = CPDrawingMode.prototype.enter; CPDrawingMode.prototype.paint = function () { - if (this.shouldPaintBrushPreview) { + // if (this.shouldPaintBrushPreview) { this.shouldPaintBrushPreview = false; var r = this.getBrushPreviewOval(); canvasContext.beginPath(); @@ -19180,7 +19180,7 @@ function CPCanvas(controller) { } else { this.oldPreviewRect.union(r); } - } + // } }; function CPFreehandMode() { CPDrawingMode.call(this); diff --git a/petitnote/app/chickenpaint/js/chickenpaint.min.js b/petitnote/app/chickenpaint/js/chickenpaint.min.js index cbc9d774..661e92cc 100644 --- a/petitnote/app/chickenpaint/js/chickenpaint.min.js +++ b/petitnote/app/chickenpaint/js/chickenpaint.min.js @@ -567,16 +567,16 @@ function ua(fa){xb.union(fa);aa()}function Ea(){fc=Ua.getBounds();Fa.repaintAll( R.prototype=Object.create(M.prototype);R.prototype.constructor=R;R.prototype.mouseDown=function(fa,Ka,Ra){var eb=e.default.isPressed("space");if(!eb&&(2==Ka||0==Ka&&fa.altKey))lb.push(wc,!0),lb.peek().mouseDown(fa,Ka,Ra);else if(!eb&&0==Ka&&!fa.altKey&&e.default.isPressed("r"))lb.push(Ub,!0),lb.peek().mouseDown(fa,Ka,Ra);else if(1==Ka||!fa.altKey&&eb&&0==Ka)lb.push(Xb,!0),lb.peek().mouseDown(fa,Ka,Ra)};R.prototype.keyDown=function(fa){if("r"===fa.key.toLowerCase()&&" "!==fa.key)lb.push(Ub,!0),lb.peek().keyDown(fa); else if("r"!==fa.key.toLowerCase()&&" "===fa.key&&!fa.altKey)return lb.push(Xb,!0),lb.peek().keyDown(fa),!0};ha.prototype=Object.create(M.prototype);ha.prototype.constructor=ha;ha.prototype.getBrushPreviewOval=function(){var fa=I.getBrushSize()*Db;return new v.default(Sa-fa/2,ob-fa/2,Sa+fa/2,ob+fa/2)};ha.prototype.queueBrushPreview=function(){if(lb.peek()==this){this.shouldPaintBrushPreview=!0;var fa=this.getBrushPreviewOval();fa.grow(2,2);null!=this.oldPreviewRect&&(fa.union(this.oldPreviewRect), this.oldPreviewRect=null);ua(fa)}};ha.prototype.eraseBrushPreview=function(){this.shouldPaintBrushPreview=!1;null!=this.oldPreviewRect&&(ua(this.oldPreviewRect),this.oldPreviewRect=null)};ha.prototype.mouseMove=function(fa,Ka){this.queueBrushPreview()};ha.prototype.enter=function(){M.prototype.enter.call(this);Tb&&this.queueBrushPreview()};ha.prototype.leave=function(){M.prototype.leave.call(this);this.eraseBrushPreview()};ha.prototype.suspend=ha.prototype.leave;ha.prototype.resume=ha.prototype.enter; -ha.prototype.paint=function(){if(this.shouldPaintBrushPreview){this.shouldPaintBrushPreview=!1;var fa=this.getBrushPreviewOval();J.beginPath();J.arc((fa.left+fa.right)/2,(fa.top+fa.bottom)/2,fa.getWidth()/2,0,2*Math.PI);J.stroke();fa.grow(2,2);null==this.oldPreviewRect?this.oldPreviewRect=fa:this.oldPreviewRect.union(fa)}};ca.prototype=Object.create(ha.prototype);ca.prototype.constructor=ca;ca.prototype.mouseDown=function(fa,Ka,Ra){if(!this.capture&&0==Ka&&!fa.altKey&&!e.default.isPressed("space")&& -S()&&(fa=Ha({x:Sa,y:ob}),this.eraseBrushPreview(),Ua.beginStroke(fa.x,fa.y,Ra)))return this.capture=!0,this.smoothMouse=fa,!0};ca.prototype.mouseDrag=function(fa,Ka){if(this.capture){fa=Ha({x:Sa,y:ob});var Ra=Math.min(.999,Math.pow(I.getBrushInfo().smoothing,.3));this.smoothMouse.x=(1-Ra)*fa.x+Ra*this.smoothMouse.x;this.smoothMouse.y=(1-Ra)*fa.y+Ra*this.smoothMouse.y;Ua.continueStroke(this.smoothMouse.x,this.smoothMouse.y,Ka);return!0}this.mouseMove(fa)};ca.prototype.mouseUp=function(fa,Ka,Ra){if(this.capture)return 0== -Ka&&(this.capture=!1,Ua.endStroke()),!0};sa.prototype=Object.create(ha.prototype);sa.prototype.constructor=sa;sa.prototype.drawLine=function(fa,Ka){Ua.beginStroke(fa.x,fa.y,1);Ua.continueStroke(Ka.x,Ka.y,1);Ua.endStroke()};na.prototype=Object.create(ha.prototype);na.prototype.constructor=na;Q.prototype=Object.create(M.prototype);Q.prototype.constructor=Q;oa.prototype=Object.create(M.prototype);oa.prototype.constructor=oa;ia.prototype=Object.create(M.prototype);ia.prototype.constructor=ia;ia.prototype.mouseDown= -function(fa,Ka,Ra){if(0==Ka&&!fa.altKey&&!e.default.isPressed("space")&&S())return fa=Ha({x:Sa,y:ob}),Ua.isPointWithin(fa.x,fa.y)&&(Ua.floodFill(fa.x,fa.y),Fa.repaintAll()),!0};ya.prototype=Object.create(M.prototype);ya.prototype.constructor=ya;ta.prototype=Object.create(M.prototype);ta.prototype.constructor=ta;ta.prototype.mouseMove=function(fa){if(!e.default.isPressed("r"))return $a("move"),!0};ta.prototype.enter=function(){$a("move")};Ga.prototype=Object.create(M.prototype);Ga.prototype.constructor= -Ga;qa.prototype=Object.create(M.prototype);qa.prototype.constructor=qa;Pa.prototype=Object.create(sa.prototype);Pa.prototype.constructor=Pa;Pa.prototype.drawLine=function(fa,Ka){Ua.gradientFill(Math.round(fa.x),Math.round(fa.y),Math.round(Ka.x),Math.round(Ka.y),I.getCurGradient())};Pa.prototype.queueBrushPreview=function(){};this.setZoom=function(fa){Db=fa;xa()};this.getZoom=function(){return Db};this.setGridSize=function(fa){Ib=Math.max(Math.round(fa),1);this.repaintAll()};this.getGridSize=function(){return Ib}; -this.setOffset=function(fa,Ka){isNaN(fa)||isNaN(Ka)?console.log("Bad offset"):(O=fa,Hb=Ka,xa())};this.getOffset=function(){return{x:O,y:Hb}};this.setInterpolation=function(fa){rc=fa;(0,d.setCanvasInterpolation)(J,fa);this.repaintAll()};this.setRotation=function(fa){bc=fa%(2*Math.PI);xa()};this.getRotation=function(){return bc};this.getRotation90=function(){var fa=Math.round(this.getRotation()/Math.PI*2);fa%=4;0>fa&&(fa+=4);return fa};this.zoomIn=function(){ba(2*this.getZoom())};this.zoomOut=function(){ba(.5* -this.getZoom())};this.zoom100=function(){ba(1);ab()};this.resetRotation=function(){var fa=D.width/2,Ka=D.height/2,Ra=new a.default;Ra.rotateAroundPoint(-this.getRotation(),fa,Ka);Ra.multiply(Lb);this.setOffset(~~Ra.getTranslateX(),~~Ra.getTranslateY());this.setRotation(0);Fa.emitEvent("canvasRotated90",[0])};var Nb=!1,dc;this.getElement=function(){return ma};this.repaintAll=function(){xb.left=0;xb.top=0;xb.right=D.width;xb.bottom=D.height;aa()};this.paint=function(){var fa=!1;jc=!1;xb.isEmpty()|| -(J.save(),J.clipTo&&(J.beginPath(),xb.left|=0,xb.top|=0,J.rect(xb.left,xb.top,Math.ceil(xb.getWidth()),Math.ceil(xb.getHeight())),J.clip()),fa=!0);if(!fc.isEmpty()){var Ka=Eb&&Eb.isOpen()?Eb.getImageData():Ua.fusionLayers().getImageData();za.putImageData(Ka,0,0,fc.left,fc.top,fc.getWidth(),fc.getHeight());fc.makeEmpty()}J.fillStyle="#606060";J.fillRect(0,0,D.width,D.height);J.save();J.setTransform(Lb.m[0],Lb.m[1],Lb.m[2],Lb.m[3],Lb.m[4],Lb.m[5]);J.fillStyle=Qa;J.fillRect(0,0,Ua.width,Ua.height);J.drawImage(Y, -0,0,Y.width,Y.height);J.restore();(0,t.setContrastingDrawStyle)(J,"stroke");J.lineWidth=1;Ua.getSelection().isEmpty()||lb.peek()instanceof ya&&lb.peek().capture||(J.setLineDash([3,2]),Ka=Ua.getSelection(),Na(J,ra(Ka)),J.setLineDash([]));if(db&&(Ka=Ua.getBounds(),2fa&&(fa+=4);return fa};this.zoomIn=function(){ba(2*this.getZoom())};this.zoomOut=function(){ba(.5*this.getZoom())}; +this.zoom100=function(){ba(1);ab()};this.resetRotation=function(){var fa=D.width/2,Ka=D.height/2,Ra=new a.default;Ra.rotateAroundPoint(-this.getRotation(),fa,Ka);Ra.multiply(Lb);this.setOffset(~~Ra.getTranslateX(),~~Ra.getTranslateY());this.setRotation(0);Fa.emitEvent("canvasRotated90",[0])};var Nb=!1,dc;this.getElement=function(){return ma};this.repaintAll=function(){xb.left=0;xb.top=0;xb.right=D.width;xb.bottom=D.height;aa()};this.paint=function(){var fa=!1;jc=!1;xb.isEmpty()||(J.save(),J.clipTo&& +(J.beginPath(),xb.left|=0,xb.top|=0,J.rect(xb.left,xb.top,Math.ceil(xb.getWidth()),Math.ceil(xb.getHeight())),J.clip()),fa=!0);if(!fc.isEmpty()){var Ka=Eb&&Eb.isOpen()?Eb.getImageData():Ua.fusionLayers().getImageData();za.putImageData(Ka,0,0,fc.left,fc.top,fc.getWidth(),fc.getHeight());fc.makeEmpty()}J.fillStyle="#606060";J.fillRect(0,0,D.width,D.height);J.save();J.setTransform(Lb.m[0],Lb.m[1],Lb.m[2],Lb.m[3],Lb.m[4],Lb.m[5]);J.fillStyle=Qa;J.fillRect(0,0,Ua.width,Ua.height);J.drawImage(Y,0,0,Y.width, +Y.height);J.restore();(0,t.setContrastingDrawStyle)(J,"stroke");J.lineWidth=1;Ua.getSelection().isEmpty()||lb.peek()instanceof ya&&lb.peek().capture||(J.setLineDash([3,2]),Ka=Ua.getSelection(),Na(J,ra(Ka)),J.setLineDash([]));if(db&&(Ka=Ua.getBounds(),2