zimjs 17.2.5 → 17.2.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zim.js +16 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "17.2.5",
3
+ "version": "17.2.6",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -50935,6 +50935,8 @@ RETURNS obj for chaining
50935
50935
  // bring stageX and stageY into the parent's frame of reference
50936
50936
  // could use e.localX and e.localY but might be dragging container or contents
50937
50937
  dragObject = (currentTarget)?e.currentTarget:e.target;
50938
+ dragObject.dragStartX = dragObject.x;
50939
+ dragObject.dragStartY = dragObject.y;
50938
50940
 
50939
50941
 
50940
50942
  if (obj.zimBoundary && !dragObject.getBounds()) {zogy("zim.drag() - drag object needs bounds set"); return;}
@@ -51224,7 +51226,8 @@ RETURNS obj for chaining
51224
51226
  lastBackT = upT = 0;
51225
51227
  }
51226
51228
 
51227
- if (Math.abs(dX) < 1 && Math.abs(dY) < 1) {
51229
+ // if (Math.abs(dX) < 1 && Math.abs(dY) < 1) {
51230
+ if (Math.abs(dragObject.x-dragObject.dragStartX) < 1 && Math.abs(dragObject.y-dragObject.dragStartY) < 1) {
51228
51231
  hasMoved = false;
51229
51232
  dragObject.dispatchEvent("slidestop");
51230
51233
  zim.Ticker.remove(obj.zimDragTicker);
@@ -55265,7 +55268,18 @@ interval(.05, ()=>{
55265
55268
 
55266
55269
  // or if you have a THREEJS mesh
55267
55270
  // use quotes to animate a dot property:
55268
- animate(mesh, {"rotation.y":360*RAD}, 50);
55271
+ animate(mesh, {"rotation.y":360*RAD}, 10);
55272
+
55273
+ // or to use the ZIM DUO technique with the animate function (not method),
55274
+ // the normal obj parameter is called target so as not to conflict
55275
+ // with the old obj parameter which is now props but is kept for legacy purposes ;-)
55276
+ animate({
55277
+ target:mesh,
55278
+ props:{"rotation.y":360*RAD},
55279
+ time:10,
55280
+ loop:true,
55281
+ rewind:true
55282
+ });
55269
55283
 
55270
55284
  // or CSS properties - see the CSS parameter for setup info
55271
55285
  zss("tagID").opacity = 1; // set this even if it is default