aotrautils 0.0.523 → 0.0.525
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aotrautils/aotrautils.build.js +156 -79
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (01/07/2023-00:22:56)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -2852,16 +2852,19 @@ window.containsOneOf=function(container, objectsToFind,/*OPTIONAL*/useRegexp=fal
|
|
|
2852
2852
|
});
|
|
2853
2853
|
};
|
|
2854
2854
|
|
|
2855
|
-
|
|
2855
|
+
|
|
2856
|
+
window.contains=function(container, objectToFind=null,/*OPTIONAL*/useRegexp=false,searchInKeysOnly=false){
|
|
2856
2857
|
if(nothing(container)){
|
|
2857
2858
|
// //TRACE
|
|
2858
2859
|
// console.log("WARN : Container is empty ! Cannot search for «"+objectToFind+"».");
|
|
2859
2860
|
return false;
|
|
2860
2861
|
}
|
|
2861
|
-
if(!isString(container) && objectToFind && isFunction(
|
|
2862
|
-
|
|
2863
|
-
if(
|
|
2862
|
+
if(!isString(container) && !objectToFind && window.contains.filterFunction && isFunction(window.contains.filterFunction)){
|
|
2863
|
+
const itemIsFound=!!foreach(container, (item, keyOrIndex)=>{
|
|
2864
|
+
if(window.contains.filterFunction(item, keyOrIndex)) return true;
|
|
2864
2865
|
});
|
|
2866
|
+
delete window.contains.filterFunction;
|
|
2867
|
+
return itemIsFound;
|
|
2865
2868
|
}else{
|
|
2866
2869
|
// Note : We also allow the search of null plain items in a container !
|
|
2867
2870
|
|
|
@@ -2893,6 +2896,11 @@ window.contains=function(container, objectToFind,/*OPTIONAL*/useRegexp=false,sea
|
|
|
2893
2896
|
return new RegExp(chunk, "gm").test(str);
|
|
2894
2897
|
}
|
|
2895
2898
|
};
|
|
2899
|
+
window.contains.filter=function(filterFunctionParam){
|
|
2900
|
+
window.contains.filterFunction=filterFunctionParam;
|
|
2901
|
+
return window.contains;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2896
2904
|
|
|
2897
2905
|
window.hasKey=function(container, keyToFind){
|
|
2898
2906
|
let result=foreach(container,(item,key)=>{
|
|
@@ -4866,7 +4874,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4866
4874
|
|
|
4867
4875
|
|
|
4868
4876
|
|
|
4869
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (
|
|
4877
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (01/07/2023-00:22:56)»*/
|
|
4870
4878
|
/*-----------------------------------------------------------------------------*/
|
|
4871
4879
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4872
4880
|
*
|
|
@@ -6224,7 +6232,21 @@ function createCookie(name, value, days=null){
|
|
|
6224
6232
|
document.cookie=name + "=" + value + expires + "; path=/";
|
|
6225
6233
|
}
|
|
6226
6234
|
|
|
6227
|
-
function storeString(name, value
|
|
6235
|
+
/*public*/function storeString(name, value, forceUseCookie=false, chunksSize=null){
|
|
6236
|
+
const strLength=value.length;
|
|
6237
|
+
if(!chunksSize || strLength<=chunksSize) return storeSingleString(name, value, forceUseCookie);
|
|
6238
|
+
const maxNumberOfChunks=Math.ceil(strLength/chunksSize);
|
|
6239
|
+
for(let nameIndex=1,chunksIndex=0,chunk;chunksIndex<maxNumberOfChunks;){
|
|
6240
|
+
chunk=value.substr(chunksIndex*chunksSize,Math.min(strLength,(chunksIndex+1)*chunksSize)-chunksIndex*chunksSize);
|
|
6241
|
+
const nameStr=name+nameIndex;
|
|
6242
|
+
storeSingleString(nameStr, chunk, forceUseCookie);
|
|
6243
|
+
nameIndex++;
|
|
6244
|
+
chunksIndex++;
|
|
6245
|
+
}
|
|
6246
|
+
return value;
|
|
6247
|
+
}
|
|
6248
|
+
/*private*/function storeSingleString(name, value, forceUseCookie=false){
|
|
6249
|
+
|
|
6228
6250
|
if((!isHTML5StorageSupported("local") || forceUseCookie ) && (typeof jQuery === "undefined" || !jQuery )){
|
|
6229
6251
|
// TRACE
|
|
6230
6252
|
log("WARN : Storage is not supported by this browser, writing to cookie.");
|
|
@@ -6258,7 +6280,19 @@ function getCookie(cookieName){
|
|
|
6258
6280
|
return "";
|
|
6259
6281
|
}
|
|
6260
6282
|
|
|
6261
|
-
function getStringFromStorage(name
|
|
6283
|
+
/*public*/function getStringFromStorage(name, forceUseCookie=false, readChunked=false){
|
|
6284
|
+
const foundString=getSingleStringFromStorage(name, forceUseCookie);
|
|
6285
|
+
if(!readChunked || foundString) return foundString;
|
|
6286
|
+
let result="";
|
|
6287
|
+
for(let nameIndex=1,foundValue=getSingleStringFromStorage(name+nameIndex, forceUseCookie);
|
|
6288
|
+
foundValue!==null;){
|
|
6289
|
+
result+=foundValue;
|
|
6290
|
+
nameIndex++;
|
|
6291
|
+
foundValue=getSingleStringFromStorage(name+nameIndex, forceUseCookie);
|
|
6292
|
+
}
|
|
6293
|
+
return result;
|
|
6294
|
+
}
|
|
6295
|
+
/*public*/function getSingleStringFromStorage(name, forceUseCookie=false){
|
|
6262
6296
|
if((!isHTML5StorageSupported("local") || forceUseCookie ) && (typeof jQuery === "undefined" || !jQuery ) ){
|
|
6263
6297
|
// TRACE
|
|
6264
6298
|
log("WARN : Storage is not supported by this browser, reading from cookie.");
|
|
@@ -6277,6 +6311,8 @@ function getStringFromStorage(name,/* OPTIONAL */forceUseCookie=false){
|
|
|
6277
6311
|
return result;
|
|
6278
6312
|
}
|
|
6279
6313
|
|
|
6314
|
+
|
|
6315
|
+
|
|
6280
6316
|
function isHTML5StorageSupported(type){
|
|
6281
6317
|
if (!nothing(type) && type === "local"){
|
|
6282
6318
|
try {
|
|
@@ -6442,6 +6478,43 @@ Function.prototype.clone=function(){
|
|
|
6442
6478
|
return temp;
|
|
6443
6479
|
};
|
|
6444
6480
|
|
|
6481
|
+
|
|
6482
|
+
/*public*/function downloadFile(name, content){
|
|
6483
|
+
const tempElement=document.createElement("a");
|
|
6484
|
+
tempElement.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));
|
|
6485
|
+
tempElement.setAttribute("download",name);
|
|
6486
|
+
tempElement.style.display="none";
|
|
6487
|
+
|
|
6488
|
+
document.body.appendChild(tempElement);
|
|
6489
|
+
tempElement.click();
|
|
6490
|
+
document.body.removeChild(tempElement);
|
|
6491
|
+
}
|
|
6492
|
+
|
|
6493
|
+
/*public*/function readFileContent(element){ // Needs an <input type="file" /> element
|
|
6494
|
+
return new Promise((onComplete,onError)=>{
|
|
6495
|
+
if(!element){
|
|
6496
|
+
onError(new Error("File input element is null, cannot read file."));
|
|
6497
|
+
return;
|
|
6498
|
+
}
|
|
6499
|
+
|
|
6500
|
+
try{
|
|
6501
|
+
|
|
6502
|
+
let file=element.files[0];
|
|
6503
|
+
if(!file) return null;
|
|
6504
|
+
const reader=new FileReader();
|
|
6505
|
+
reader.onload=(e)=>{
|
|
6506
|
+
const content=e.target.result;
|
|
6507
|
+
onComplete(content);
|
|
6508
|
+
};
|
|
6509
|
+
|
|
6510
|
+
reader.readAsText(file);
|
|
6511
|
+
}catch(error){
|
|
6512
|
+
onError(error);
|
|
6513
|
+
}
|
|
6514
|
+
});
|
|
6515
|
+
}
|
|
6516
|
+
|
|
6517
|
+
|
|
6445
6518
|
// Drawing and graphics management :
|
|
6446
6519
|
|
|
6447
6520
|
function getBeamLikeGradient(ctx, displayX1, displayY1, displayX2, displayY2, size, color, alpha,/* OPTIONAL */zoomFactor){
|
|
@@ -7988,9 +8061,9 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
7988
8061
|
mediaHandler.video.volume=0.0000000000001;
|
|
7989
8062
|
// mediaHandler.video.autoplay=true;
|
|
7990
8063
|
|
|
7991
|
-
if(tagConfig && tagConfig.videoToUse && tagConfig.
|
|
7992
|
-
if(isNumber(tagConfig.
|
|
7993
|
-
mediaHandler.video.style.scale=tagConfig.
|
|
8064
|
+
if(tagConfig && tagConfig.videoToUse && tagConfig.videoScale){
|
|
8065
|
+
if(isNumber(tagConfig.videoScale)){
|
|
8066
|
+
mediaHandler.video.style.scale=tagConfig.videoScale;
|
|
7994
8067
|
}
|
|
7995
8068
|
}
|
|
7996
8069
|
|
|
@@ -8181,7 +8254,7 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
8181
8254
|
|
|
8182
8255
|
// CAUTION : uses a temporary canvas !
|
|
8183
8256
|
drawVideoImage=function(canvas,videoImage,
|
|
8184
|
-
/*OPTIONAL*/xParam,/*OPTIONAL*/yParam,/*OPTIONAL*/
|
|
8257
|
+
/*OPTIONAL*/xParam,/*OPTIONAL*/yParam,/*OPTIONAL*/zoomsParam,
|
|
8185
8258
|
/*OPTIONAL*/newWidthParam,/*OPTIONAL*/newHeightParam,
|
|
8186
8259
|
/*OPTIONAL*/isMessWithAlpha){
|
|
8187
8260
|
|
|
@@ -8191,7 +8264,7 @@ drawVideoImage=function(canvas,videoImage,
|
|
|
8191
8264
|
|
|
8192
8265
|
var x=nonull(xParam,0);
|
|
8193
8266
|
var y=nonull(yParam,0);
|
|
8194
|
-
|
|
8267
|
+
const zooms=nonull(zoomsParam,{zx:1,zy:1});
|
|
8195
8268
|
|
|
8196
8269
|
var newWidth=newWidthParam?newWidthParam:canvas.width;
|
|
8197
8270
|
var newHeight=newHeightParam?newHeightParam:canvas.height;
|
|
@@ -8275,7 +8348,7 @@ drawVideoImage=function(canvas,videoImage,
|
|
|
8275
8348
|
|
|
8276
8349
|
tempCtx.restore();
|
|
8277
8350
|
|
|
8278
|
-
ctx.scale(nonull(scaleX,scaleY)*
|
|
8351
|
+
ctx.scale(nonull(scaleX,scaleY)*zooms.zx, nonull(scaleY,scaleX)*zooms.zy); // default values are replaceable (to make sure we actually choose one) !
|
|
8279
8352
|
|
|
8280
8353
|
// NO : PROVOKES BLINKING: ctx.clearRect(0, 0, newWidth, newHeight);
|
|
8281
8354
|
ctx.drawImage(tempCanvas,x,y);
|
|
@@ -8869,29 +8942,29 @@ function loadSound(filePath,doOnLoaded=null,doOnEnded=null){
|
|
|
8869
8942
|
|
|
8870
8943
|
|
|
8871
8944
|
|
|
8872
|
-
function
|
|
8945
|
+
function getZoomedCenteredZoneCoords(xParam,yParam,width,height,center={x:"left",y:"top"}, zooms={zx:1,zy:1}){
|
|
8873
8946
|
|
|
8874
8947
|
if(center===null) center={x:"left",y:"top"};
|
|
8875
8948
|
|
|
8876
8949
|
let x=xParam; // case "left"
|
|
8877
8950
|
if(center.x==="center"){
|
|
8878
|
-
x=xParam-Math.floor(width*.5);
|
|
8951
|
+
x=(xParam-Math.floor(width*.5));
|
|
8879
8952
|
}else if(center.x==="right"){
|
|
8880
|
-
x=xParam-width;
|
|
8953
|
+
x=(xParam-width);
|
|
8881
8954
|
}
|
|
8882
8955
|
|
|
8883
8956
|
let y=yParam; // case "top"
|
|
8884
8957
|
if(center.y==="center"){
|
|
8885
|
-
y=yParam-Math.floor(height*.5);
|
|
8958
|
+
y=(yParam-Math.floor(height*.5));
|
|
8886
8959
|
}else if(center.y==="bottom"){
|
|
8887
|
-
y=yParam-height;
|
|
8960
|
+
y=(yParam-height);
|
|
8888
8961
|
}
|
|
8889
8962
|
|
|
8890
|
-
return {x:x,y:y,w:width,h:height,center:center};
|
|
8963
|
+
return {x:x*zooms.zx, y:y*zooms.zy, w:width*zooms.zx, h:height*zooms.zy, center:center};
|
|
8891
8964
|
}
|
|
8892
8965
|
|
|
8893
8966
|
|
|
8894
|
-
function
|
|
8967
|
+
function drawImageAndCenterWithZooms(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center={x:"left",y:"top"},
|
|
8895
8968
|
scaleFactorW=1,scaleFactorH=1,
|
|
8896
8969
|
sizeW=null,sizeH=null,
|
|
8897
8970
|
opacity=1,
|
|
@@ -8902,11 +8975,14 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8902
8975
|
|
|
8903
8976
|
let clipPos=(clip?{x:clip.x, y:clip.y}:{x:0,y:0});
|
|
8904
8977
|
let clipSize=(clip?{w:clip.w, h:clip.h}:{w:image.width,h:image.height});
|
|
8978
|
+
|
|
8979
|
+
const drawingWidth=nonull(sizeW, Math.trunc(clipSize.w*scaleFactorW));
|
|
8980
|
+
const drawingHeight=nonull(sizeH, Math.trunc(clipSize.h*scaleFactorH));
|
|
8981
|
+
zooms=nonull(zooms,{zx:1,zy:1});
|
|
8982
|
+
const zoomedDrawingWidth=drawingWidth*zooms.zx;
|
|
8983
|
+
const zoomedDrawingHeight=drawingHeight*zooms.zy;
|
|
8905
8984
|
|
|
8906
|
-
|
|
8907
|
-
let drawingHeight=nonull(sizeH, Math.trunc(clipSize.h*scaleFactorH));
|
|
8908
|
-
|
|
8909
|
-
let centeredCoords=getCenteredZoneCoords(xParam,yParam,drawingWidth,drawingHeight,center);
|
|
8985
|
+
const zoomedCenteredCoords=getZoomedCenteredZoneCoords(xParam,yParam,drawingWidth,drawingHeight,center,zooms);
|
|
8910
8986
|
|
|
8911
8987
|
if((opacity!==1 && opacity!==0 ) || alphaAngleRadians!=null){
|
|
8912
8988
|
if(!preserveContextState || alphaAngleRadians!=null) ctx.save();
|
|
@@ -8918,6 +8994,10 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8918
8994
|
|
|
8919
8995
|
if(opacity!==0){
|
|
8920
8996
|
|
|
8997
|
+
const x=zoomedCenteredCoords.x;
|
|
8998
|
+
const y=zoomedCenteredCoords.y;
|
|
8999
|
+
|
|
9000
|
+
|
|
8921
9001
|
if(alphaAngleRadians==null){
|
|
8922
9002
|
|
|
8923
9003
|
ctx.drawImage(image,
|
|
@@ -8925,39 +9005,31 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8925
9005
|
clipPos.x, clipPos.y,
|
|
8926
9006
|
clipSize.w, clipSize.h,
|
|
8927
9007
|
// Drawing destination (including scaling) :
|
|
8928
|
-
|
|
8929
|
-
|
|
9008
|
+
x, y,
|
|
9009
|
+
zoomedDrawingWidth, zoomedDrawingHeight);
|
|
8930
9010
|
}else{
|
|
8931
9011
|
|
|
8932
9012
|
let angleRadians=alphaAngleRadians;
|
|
8933
9013
|
|
|
8934
|
-
let demiW=
|
|
8935
|
-
let demiH=
|
|
9014
|
+
let demiW=zoomedDrawingWidth*.5;
|
|
9015
|
+
let demiH=zoomedDrawingHeight*.5;
|
|
8936
9016
|
|
|
8937
9017
|
// Default rotation center is the center of the image :
|
|
8938
9018
|
let rotationCenterOffsetX=demiW;
|
|
8939
9019
|
let rotationCenterOffsetY=demiH;
|
|
8940
9020
|
if(center){
|
|
8941
|
-
if(center.x=="left")
|
|
8942
|
-
else if(center.x=="right") rotationCenterOffsetX=
|
|
9021
|
+
if(center.x=="left") rotationCenterOffsetX=0;
|
|
9022
|
+
else if(center.x=="right") rotationCenterOffsetX=zoomedDrawingWidth;
|
|
8943
9023
|
// Default rotation center is the center of the image.
|
|
8944
|
-
if(center.y=="top")
|
|
8945
|
-
else if(center.y=="bottom") rotationCenterOffsetY=
|
|
9024
|
+
if(center.y=="top") rotationCenterOffsetY=0; // CAUTION : Y axis is inverted here !
|
|
9025
|
+
else if(center.y=="bottom") rotationCenterOffsetY=zoomedDrawingHeight; // CAUTION : Y axis is inverted here !
|
|
8946
9026
|
// Default rotation center is the center of the image.
|
|
8947
9027
|
}
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
// ctx.translate(x+demiW -t.x, y+demiH -t.y);
|
|
8954
|
-
// ctx.rotate(angleRadians);
|
|
8955
|
-
|
|
8956
|
-
let x=centeredCoords.x;
|
|
8957
|
-
let y=centeredCoords.y;
|
|
8958
|
-
const a= Math.coerceAngle(-angleRadians,true,true); // BECAUSE Y AXIS IS INVERTED !
|
|
8959
|
-
let t=Math.rotateAround(a, rotationCenterOffsetX, rotationCenterOffsetY);
|
|
8960
|
-
ctx.translate(x+rotationCenterOffsetX-t.x, y-t.y+rotationCenterOffsetY);
|
|
9028
|
+
|
|
9029
|
+
|
|
9030
|
+
const a=Math.coerceAngle(-angleRadians,true,true); // BECAUSE Y AXIS IS INVERTED !
|
|
9031
|
+
const t=Math.rotateAround(a, rotationCenterOffsetX, rotationCenterOffsetY);
|
|
9032
|
+
ctx.translate((x+rotationCenterOffsetX-t.x), (y-t.y+rotationCenterOffsetY));
|
|
8961
9033
|
ctx.rotate(a);
|
|
8962
9034
|
|
|
8963
9035
|
ctx.drawImage(image,
|
|
@@ -8966,7 +9038,7 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8966
9038
|
clipSize.w, clipSize.h,
|
|
8967
9039
|
// Drawing destination (including scaling) :
|
|
8968
9040
|
0,0,
|
|
8969
|
-
|
|
9041
|
+
zoomedDrawingWidth, zoomedDrawingHeight);
|
|
8970
9042
|
|
|
8971
9043
|
}
|
|
8972
9044
|
|
|
@@ -8977,7 +9049,7 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8977
9049
|
ctx.restore();
|
|
8978
9050
|
}
|
|
8979
9051
|
|
|
8980
|
-
return
|
|
9052
|
+
return zoomedCenteredCoords;
|
|
8981
9053
|
}
|
|
8982
9054
|
|
|
8983
9055
|
|
|
@@ -8989,7 +9061,8 @@ function drawImageAndCenter(ctx,image,xParam=0,yParam=0,zooms={zx:1,zy:1},center
|
|
|
8989
9061
|
function getSpriteMonoThreaded(imagesPool,/*OPTIONAL*/refreshMillis=null,
|
|
8990
9062
|
clipSize={w:100,h:100},scaleFactorW=1,scaleFactorH=1,
|
|
8991
9063
|
orientation="horizontal",xOffset=0,yOffset=0,isLoop=true,isRandom=false,
|
|
8992
|
-
center={x:"left",y:"top"},
|
|
9064
|
+
center={x:"left",y:"top"},
|
|
9065
|
+
zoomsParam={zx:1,zy:1}){
|
|
8993
9066
|
|
|
8994
9067
|
|
|
8995
9068
|
// Two-states : started, stopped.
|
|
@@ -9005,7 +9078,7 @@ function getSpriteMonoThreaded(imagesPool,/*OPTIONAL*/refreshMillis=null,
|
|
|
9005
9078
|
scaleFactorH:scaleFactorH,
|
|
9006
9079
|
xOffset:xOffset,
|
|
9007
9080
|
yOffset:yOffset,
|
|
9008
|
-
|
|
9081
|
+
zooms:nonull(zoomsParam,{zx:1,zy:1}),
|
|
9009
9082
|
|
|
9010
9083
|
// Clip only attributes:
|
|
9011
9084
|
clipSize:(isClip?clipSize:null),
|
|
@@ -9025,7 +9098,7 @@ function getSpriteMonoThreaded(imagesPool,/*OPTIONAL*/refreshMillis=null,
|
|
|
9025
9098
|
},
|
|
9026
9099
|
|
|
9027
9100
|
// Draw :
|
|
9028
|
-
|
|
9101
|
+
drawOnEachStepZoomedIfNeeded:function(ctx,xParam,yParam,angle=null,opacity=1){
|
|
9029
9102
|
|
|
9030
9103
|
let drawingWidth, drawingHeight;
|
|
9031
9104
|
let img=null;
|
|
@@ -9062,31 +9135,19 @@ function getSpriteMonoThreaded(imagesPool,/*OPTIONAL*/refreshMillis=null,
|
|
|
9062
9135
|
}
|
|
9063
9136
|
|
|
9064
9137
|
|
|
9065
|
-
// OLD :
|
|
9066
|
-
// let centeredCoords=getCenteredZoneCoords(xParam,yParam,drawingWidth,drawingHeight,self.center);
|
|
9067
|
-
//
|
|
9068
|
-
// // TODO : ADD COLOR LAYER !...
|
|
9069
|
-
//
|
|
9070
|
-
// // Drawing the sprite image, centered with the wished center :
|
|
9071
|
-
// ctx.drawImage(
|
|
9072
|
-
// nonull(img, self.imagesPool),
|
|
9073
|
-
// (isClip?clipX:0), (isClip?clipY:0),
|
|
9074
|
-
// self.clipSize.w, self.clipSize.h,
|
|
9075
|
-
// centeredCoords.x+self.xOffset, centeredCoords.y+self.yOffset,
|
|
9076
|
-
// drawingWidth, drawingHeight);
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
9138
|
const xImage=xParam+self.xOffset;
|
|
9080
9139
|
const yImage=yParam+self.yOffset;
|
|
9081
9140
|
|
|
9082
|
-
|
|
9141
|
+
const zooms=self.zooms;
|
|
9142
|
+
|
|
9143
|
+
drawImageAndCenterWithZooms(ctx, nonull(img,self.imagesPool),
|
|
9083
9144
|
xImage, yImage,
|
|
9084
|
-
|
|
9145
|
+
zooms,
|
|
9085
9146
|
self.center,
|
|
9086
|
-
(self.scaleFactorW
|
|
9087
|
-
(self.scaleFactorH
|
|
9088
|
-
(!isClip?(drawingWidth
|
|
9089
|
-
(!isClip?(drawingHeight
|
|
9147
|
+
(self.scaleFactorW),
|
|
9148
|
+
(self.scaleFactorH),
|
|
9149
|
+
(!isClip?(drawingWidth):null),
|
|
9150
|
+
(!isClip?(drawingHeight):null),
|
|
9090
9151
|
opacity,
|
|
9091
9152
|
false,
|
|
9092
9153
|
(isClip?{x:clipX,y:clipY, w:self.clipSize.w, h:self.clipSize.h}:{x:0,y:0, w:self.clipSize.w, h:self.clipSize.h}),
|
|
@@ -9114,10 +9175,6 @@ function getSpriteMonoThreaded(imagesPool,/*OPTIONAL*/refreshMillis=null,
|
|
|
9114
9175
|
}
|
|
9115
9176
|
}
|
|
9116
9177
|
|
|
9117
|
-
// DOES NOT WORK :
|
|
9118
|
-
// return ctx.getImageData(clipX,clipY,drawingWidth,drawingHeight);
|
|
9119
|
-
// }else{
|
|
9120
|
-
// return ctx.getImageData(0,0,drawingWidth,drawingHeight);
|
|
9121
9178
|
}
|
|
9122
9179
|
},
|
|
9123
9180
|
|
|
@@ -13078,7 +13135,13 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
13078
13135
|
};
|
|
13079
13136
|
|
|
13080
13137
|
|
|
13081
|
-
|
|
13138
|
+
|
|
13139
|
+
|
|
13140
|
+
|
|
13141
|
+
|
|
13142
|
+
|
|
13143
|
+
|
|
13144
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (01/07/2023-00:22:56)»*/
|
|
13082
13145
|
/*-----------------------------------------------------------------------------*/
|
|
13083
13146
|
|
|
13084
13147
|
|
|
@@ -13743,7 +13806,18 @@ window.getSunShadowProjectedPoint=function(originalPoint,angleDegreesParam,groun
|
|
|
13743
13806
|
}
|
|
13744
13807
|
|
|
13745
13808
|
|
|
13746
|
-
window.isInZone=function(point, zone, zoneOffsets=null, center={x:"center",y:"center",z:"center"}, invertYAxis=false){
|
|
13809
|
+
window.isInZone=function(point, zone, zoneOffsets=null, center={x:"center",y:"center",z:"center"}, invertYAxis=false, zooms=null){
|
|
13810
|
+
|
|
13811
|
+
if(!center){
|
|
13812
|
+
center={x:"center",y:"center",z:"center"}
|
|
13813
|
+
}
|
|
13814
|
+
if(invertYAxis==null){
|
|
13815
|
+
invertYAxis=false;
|
|
13816
|
+
}
|
|
13817
|
+
if(zooms){
|
|
13818
|
+
point=getZoomedPosition(point, zooms);
|
|
13819
|
+
zone=getZoomedZone(zone, zooms);
|
|
13820
|
+
}
|
|
13747
13821
|
|
|
13748
13822
|
let pointX=point.x;
|
|
13749
13823
|
let pointY=point.y;
|
|
@@ -14306,7 +14380,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14306
14380
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14307
14381
|
|
|
14308
14382
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14309
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (
|
|
14383
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (01/07/2023-00:22:56)»*/
|
|
14310
14384
|
/*-----------------------------------------------------------------------------*/
|
|
14311
14385
|
|
|
14312
14386
|
|
|
@@ -14734,6 +14808,7 @@ WebsocketImplementation={
|
|
|
14734
14808
|
};
|
|
14735
14809
|
|
|
14736
14810
|
|
|
14811
|
+
///!!!
|
|
14737
14812
|
nodeServerInstance.receptionEntryPoints.push(receptionEntryPoint);
|
|
14738
14813
|
|
|
14739
14814
|
// SPECIAL FOR THE SOCKETIO IMPLEMENTATION :
|
|
@@ -15069,6 +15144,7 @@ WebsocketImplementation={
|
|
|
15069
15144
|
};
|
|
15070
15145
|
|
|
15071
15146
|
|
|
15147
|
+
///!!!
|
|
15072
15148
|
nodeClientInstance.receptionEntryPoints.push(receptionEntryPoint);
|
|
15073
15149
|
|
|
15074
15150
|
// SPECIAL FOR THE SOCKETIO IMPLEMENTATION :
|
|
@@ -15266,8 +15342,9 @@ WebsocketImplementation={
|
|
|
15266
15342
|
}
|
|
15267
15343
|
};
|
|
15268
15344
|
|
|
15345
|
+
///!!!
|
|
15269
15346
|
// TODO : ADD TO ALL OTHER SUBSYSTEMS !
|
|
15270
|
-
if(!contains
|
|
15347
|
+
if(!contains.filter((l)=>(l.id && receptionEntryPoint.id && l.id===receptionEntryPoint.id))(browserInstance.receptionEntryPoints))
|
|
15271
15348
|
browserInstance.receptionEntryPoints.push(receptionEntryPoint);
|
|
15272
15349
|
|
|
15273
15350
|
// SPECIAL FOR THE SOCKETIO IMPLEMENTATION :
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.525",
|
|
4
4
|
"main": "aotrautils.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|