zimjs 18.2.6 → 18.2.8
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.
- package/package.json +1 -1
- package/src/zim.js +53 -8
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -9319,7 +9319,10 @@ Used internally by ZIM to globally dispose common connections
|
|
|
9319
9319
|
}
|
|
9320
9320
|
if (obj.cacheCanvas) obj.uncache();
|
|
9321
9321
|
if (zim.KEYFOCUS == obj) zim.KEYFOCUS = null;
|
|
9322
|
-
if (WW.KEYFOCUS == obj) WW.KEYFOCUS = null;
|
|
9322
|
+
if (WW.KEYFOCUS == obj) WW.KEYFOCUS = null;
|
|
9323
|
+
if (obj.stage && obj.stage.frame) obj.stage.frame.cursorList.remove(obj);
|
|
9324
|
+
else if (zdf) zdf.cursorList.remove(obj);
|
|
9325
|
+
if (obj.zimMask) obj.setMask(null);
|
|
9323
9326
|
if (obj.veeObj) obj.veeObj = null;
|
|
9324
9327
|
if (obj.draggable) obj.noDrag();
|
|
9325
9328
|
if (obj.zimTweens) obj.stopAnimate();
|
|
@@ -9332,7 +9335,9 @@ Used internally by ZIM to globally dispose common connections
|
|
|
9332
9335
|
if (obj.zimClickUpEvent) obj.zimClickUpEvent = null;
|
|
9333
9336
|
if (obj.physics) obj.removePhysics();
|
|
9334
9337
|
if (obj.name && zim.zimObjectIDs[obj.name] == obj) delete zim.zimObjectIDs[obj.name];
|
|
9335
|
-
}
|
|
9338
|
+
}
|
|
9339
|
+
|
|
9340
|
+
|
|
9336
9341
|
//-50.435
|
|
9337
9342
|
|
|
9338
9343
|
/*--
|
|
@@ -29287,11 +29292,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29287
29292
|
hitArea.y = -content.y;
|
|
29288
29293
|
}
|
|
29289
29294
|
if (damp) {
|
|
29290
|
-
desiredY = vscrollBar.proportion.convert(vscrollBar.y);
|
|
29291
|
-
testContent();
|
|
29295
|
+
desiredY = vscrollBar.proportion.convert(vscrollBar.y);
|
|
29292
29296
|
} else {
|
|
29293
29297
|
content.y = vscrollBar.proportion.convert(vscrollBar.y);
|
|
29294
29298
|
desiredY = that.scrollY;
|
|
29299
|
+
testContent();
|
|
29295
29300
|
}
|
|
29296
29301
|
|
|
29297
29302
|
});
|
|
@@ -29658,7 +29663,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29658
29663
|
return that;
|
|
29659
29664
|
};
|
|
29660
29665
|
|
|
29661
|
-
function setdragBoundary(on) {
|
|
29666
|
+
function setdragBoundary(on) {
|
|
29662
29667
|
if (continuous) return;
|
|
29663
29668
|
if (zot(stage)) stage = that.stage || WW.zdf.stage;
|
|
29664
29669
|
if (zot(on)) on = true;
|
|
@@ -29723,7 +29728,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29723
29728
|
if (zot(delay)) delay = 100;
|
|
29724
29729
|
makeDamp(that);
|
|
29725
29730
|
if (!swipe) return;
|
|
29726
|
-
setTimeout(function(){
|
|
29731
|
+
setTimeout(function(){
|
|
29727
29732
|
if (!that.enabled) return;
|
|
29728
29733
|
if (content) {
|
|
29729
29734
|
zim.drag({
|
|
@@ -29970,10 +29975,29 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29970
29975
|
set: function(value) {
|
|
29971
29976
|
if (!value) {
|
|
29972
29977
|
clearTimeout(that.dTimeout);
|
|
29978
|
+
if (vEvent) {
|
|
29979
|
+
vscrollBar.off("pressmove", vEvent);
|
|
29980
|
+
vscrollBar.dragPaused = true;
|
|
29981
|
+
}
|
|
29982
|
+
if (hEvent) {
|
|
29983
|
+
hscrollBar.off("pressmove", hEvent);
|
|
29984
|
+
hscrollBar.dragPaused = true;
|
|
29985
|
+
}
|
|
29973
29986
|
zim.noDrag(content);
|
|
29987
|
+
setTimeout(function(){
|
|
29988
|
+
stageUp();
|
|
29989
|
+
},50);
|
|
29974
29990
|
} else {
|
|
29991
|
+
if (vEvent) {
|
|
29992
|
+
vEvent = vscrollBar.on("pressmove", vEvent);
|
|
29993
|
+
vscrollBar.dragPaused = false;
|
|
29994
|
+
}
|
|
29995
|
+
if (hEvent) {
|
|
29996
|
+
hEvent = hscrollBar.on("pressmove", hEvent);
|
|
29997
|
+
hscrollBar.dragPaused = false;
|
|
29998
|
+
}
|
|
29975
29999
|
swipeCheck = false;
|
|
29976
|
-
setDrag();
|
|
30000
|
+
setDrag();
|
|
29977
30001
|
}
|
|
29978
30002
|
if (that.blinker) {
|
|
29979
30003
|
if (!value) {
|
|
@@ -83192,6 +83216,28 @@ pen.animate({
|
|
|
83192
83216
|
})
|
|
83193
83217
|
END EXAMPLE
|
|
83194
83218
|
|
|
83219
|
+
EXAMPLE
|
|
83220
|
+
// Drawing inside an area
|
|
83221
|
+
// https://zimjs.com/zapp/Z_NSS5X
|
|
83222
|
+
|
|
83223
|
+
const holder = new Rectangle({width:400, height:200, corner:50}).center();
|
|
83224
|
+
// so when adding pen to holder, we can interact with it
|
|
83225
|
+
holder.mouseChildren = true;
|
|
83226
|
+
|
|
83227
|
+
const pen = new Pen({
|
|
83228
|
+
size:12,
|
|
83229
|
+
color:red,
|
|
83230
|
+
cropScale:2
|
|
83231
|
+
}).addTo(holder); // add to holder so mousedown of MotionController is only on holder
|
|
83232
|
+
pen.paper.setMask(holder.shape); // shape inside to keep mask right
|
|
83233
|
+
|
|
83234
|
+
const motionController = new MotionController({
|
|
83235
|
+
target:pen,
|
|
83236
|
+
type:"pressmove",
|
|
83237
|
+
container:holder
|
|
83238
|
+
});
|
|
83239
|
+
END EXAMPLE
|
|
83240
|
+
|
|
83195
83241
|
EXAMPLE
|
|
83196
83242
|
// A Pen used on two different Pages with ZIM Pages
|
|
83197
83243
|
// See https://zimjs.com/zapp/Z_VKB33
|
|
@@ -93205,7 +93251,6 @@ and a "tabfocus" event to the ZIM Default Frame when focused
|
|
|
93205
93251
|
|
|
93206
93252
|
zim.setBlurDetect = function() {
|
|
93207
93253
|
z_d("83.36");
|
|
93208
|
-
|
|
93209
93254
|
zim.blurCheck = true;
|
|
93210
93255
|
zim.pauseAnimateOnBlur = true;
|
|
93211
93256
|
zim.pauseOnBlur = [];
|