From 5c09926bb3220549d7602791daf2e548f5e764c1 Mon Sep 17 00:00:00 2001 From: Andres Eloy Rivera Garcia Date: Sat, 13 Jan 2024 14:06:03 +0100 Subject: [PATCH] chore: update main.js to v1.0.1 --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index a8e9c8f..c200890 100644 --- a/main.js +++ b/main.js @@ -1 +1 @@ -"use strict";function t(t,e,o){if(o||2===arguments.length)for(var n,r=0,i=e.length;ro?(p=o,i=n-a):a>n&&(a=n,c=o-p),m.y-=Math.ceil(i/2),m.x-=Math.ceil(c/2);var s=Math.min(e.width/p,e.height/a);m.w=Math.ceil(m.w*s),m.h=Math.ceil(m.h*s),m.x=Math.ceil(m.x*s),m.y=Math.ceil(m.y*s)},f=function(){delete m.h,delete m.w,delete m.y,delete m.x,delete m.constY,delete m.constX,p("Crop reset")},h=function(t,e){if(!e||"object"!=typeof e||!("x"in e)||!("y"in e)||"number"!=typeof e.x||"number"!=typeof e.y)throw new Error("Did not receive mouse coordinates: ".concat(JSON.stringify(e)));g({x:e.x,y:e.y}),_()},_=function(){if(!x(m))throw new Error("cropbox is not set");var t="{\\3c&".concat(r.cropBox.color,"&}"),e=v("osd");u.res_y=e.height,u.res_x=e.width;var o=m.x,n=m.y,i=m.w,c=m.h,p="{\\p1}m ".concat(o," ").concat(n," l ").concat(o+i," ").concat(n," ").concat(o+i," ")+"".concat(n+c," ").concat(o," ").concat(n+c," {\\p0}"),a="".concat("{\\pos(0, 0)}").concat(t).concat("{\\1a&FF&}").concat("{\\bord4}").concat(p);u.data=a,u.update()},g=function(t){if("number"!=typeof m.constX||"number"!=typeof m.constY||"number"!=typeof m.x||"number"!=typeof m.y)throw new Error("the cropbox was not initialized: ".concat(JSON.stringify(m)));t.xo?(p=o,i=n-a):a>n&&(a=n,c=o-p),m.y-=Math.ceil(i/2),m.x-=Math.ceil(c/2);var s=Math.min(e.width/p,e.height/a);m.w=Math.ceil(m.w*s),m.h=Math.ceil(m.h*s),m.x=Math.ceil(m.x*s),m.y=Math.ceil(m.y*s)},f=function(){delete m.h,delete m.w,delete m.y,delete m.x,delete m.constY,delete m.constX,p("Crop reset")},h=function(t,e){if(!e||"object"!=typeof e||!("x"in e)||!("y"in e)||"number"!=typeof e.x||"number"!=typeof e.y)throw new Error("Did not receive mouse coordinates: ".concat(JSON.stringify(e)));g({x:e.x,y:e.y}),_()},_=function(){if(!x(m))throw new Error("cropbox is not set");var t="{\\3c&".concat(r.cropBox.color,"&}"),e=v("osd");u.res_y=e.height,u.res_x=e.width;var o=m.x,n=m.y,i=m.w,c=m.h,p="{\\p1}m ".concat(o," ").concat(n," l ").concat(o+i," ").concat(n," ").concat(o+i," ")+"".concat(n+c," ").concat(o," ").concat(n+c," {\\p0}"),a="".concat("{\\pos(0, 0)}").concat(t).concat("{\\1a&FF&}").concat("{\\bord4}").concat(p);u.data=a,u.update()},g=function(t){if("number"!=typeof m.constX||"number"!=typeof m.constY||"number"!=typeof m.x||"number"!=typeof m.y)throw new Error("the cropbox was not initialized: ".concat(JSON.stringify(m)));t.x