zimjs 18.2.2 → 18.2.4

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 +25 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "18.2.2",
3
+ "version": "18.2.4",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -1743,7 +1743,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1743
1743
  r = call(obj.item(i), i, total, start, end, obj, io);
1744
1744
  }
1745
1745
 
1746
- if (r == 'next') io.next();
1746
+ if (r == 'next' && i < total-1) io.next();
1747
1747
  else if (typeof r != 'undefined') {
1748
1748
  io.clear();
1749
1749
  return r;
@@ -1780,7 +1780,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1780
1780
  r = call(obj.item(i), i, total, start, end, obj, io);
1781
1781
  }
1782
1782
 
1783
- if (r == 'next') io.next();
1783
+ if (r == 'next' && i < total-1) io.next();
1784
1784
  else if (typeof r != 'undefined') {
1785
1785
  io.clear();
1786
1786
  return r;
@@ -1814,7 +1814,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1814
1814
 
1815
1815
  r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
1816
1816
 
1817
- if (r == 'next') io.next();
1817
+ if (r == 'next' && i < total-1) io.next();
1818
1818
  else if (typeof r != 'undefined') {
1819
1819
  io.clear();
1820
1820
  return r;
@@ -1835,7 +1835,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1835
1835
 
1836
1836
  r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
1837
1837
 
1838
- if (r == 'next') io.next();
1838
+ if (r == 'next' && i < total-1) io.next();
1839
1839
  else if (typeof r != 'undefined') {
1840
1840
  io.clear();
1841
1841
  return r;
@@ -2148,8 +2148,8 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
2148
2148
  obj.paused = state;
2149
2149
  };
2150
2150
  obj.next = function() {
2151
- obj.count++;
2152
- (call)(obj);
2151
+ obj.count++;
2152
+ (call)(obj);
2153
2153
  checkTotal();
2154
2154
  };
2155
2155
  obj.clear = function() {
@@ -14784,9 +14784,7 @@ function makeShader(DS, width, height, fragment, uniforms, vertex, dynamic, preC
14784
14784
  if (preCall && typeof preCall=="function") preCall(program, gl, canvas); // ZIM
14785
14785
  gl.useProgram(program);
14786
14786
  var vertexData = [];
14787
- if (postCall && typeof postCall=="function") {
14788
- postCall(program, gl, canvas, vertexData);
14789
- }
14787
+ if (postCall && typeof postCall=="function") postCall(program, gl, canvas, vertexData); // ZIM
14790
14788
 
14791
14789
  if (strip) {
14792
14790
  if (vertexData.length == 0) vertexData = [1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0]; // two triangles strips
@@ -14835,8 +14833,7 @@ function makeShader(DS, width, height, fragment, uniforms, vertex, dynamic, preC
14835
14833
  var mou = tether.globalToLocal(tether.stage.frame.mouseX, tether.stage.frame.mouseY);
14836
14834
  setUniform("4f", "iMouse", mou.x, height-mou.y, downCheck?1:0, clickCheck?1:0);
14837
14835
  clickCheck = false;
14838
- }
14839
-
14836
+ }
14840
14837
  if (strip) gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
14841
14838
  else gl.drawArrays(gl.TRIANGLES, 0, vertexData.length);
14842
14839
 
@@ -30556,7 +30553,7 @@ var layer = new Layer().center();
30556
30553
  timeout(100, function(){zog(layer.transformControls);}); // will probably do the trick
30557
30554
  The transformControls property holds the following:
30558
30555
 
30559
- TRANSFORM CONTROL OBJECT PROPERTIES
30556
+ TRANSFORM CONTROLS OBJECT PROPERTIES
30560
30557
  visible - read only whether the controls are visible
30561
30558
  ghost - read only as to whether the ghost outline is showing - set with showGhost and hideGhost
30562
30559
  ghostEnabled - read only as to whether the ghost outline will be turned on and off - set with addGhost and removeGhost
@@ -30565,7 +30562,7 @@ stretchXControls - reference to the Container that holds the left and right boxe
30565
30562
  stretchYControls - reference to the Container that holds the top and bottom boxes for stretching
30566
30563
  rotateControls - reference to the Container that holds the outer circles for rotating
30567
30564
 
30568
- TRANSFORM CONTROL OBJECT METHODS
30565
+ TRANSFORM CONTROLS OBJECT METHODS
30569
30566
  hide() - hides the controls - returns object for chaining
30570
30567
  show() - shows the controls - returns object for chaining
30571
30568
  recordData(toJSON) - returns an object with type, x, y, scaleX, scaleY, rotation, skewX, skewY, visible PROPERTIES
@@ -37024,7 +37021,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
37024
37021
  selector.mouseEnabled = false;
37025
37022
  });
37026
37023
  this.selector = selector;
37027
- } else {
37024
+ } else {
37028
37025
  selector = this.selector = new zim.Rectangle(targetW, targetH, zim.faint, zim.faint, borderWidth, corner, dashed, {ignoreScale:!resizeScale})
37029
37026
  .centerReg(that);
37030
37027
  selector.loc(tile.width/2, target.y+paddingV, that, behind?0:1);
@@ -60597,7 +60594,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60597
60594
  zim.loop = function(obj, call, reverse, interval, step, start, end, immediate, complete, completeParams) {
60598
60595
  var sig = "obj, call, reverse, interval, step, start, end, immediate, complete, completeParams";
60599
60596
  var duo; if (duo = zob(zim.loop, arguments, sig)) return duo;
60600
-
60597
+
60601
60598
  if (!zim.zimLoopCheck) z_d("45.3");
60602
60599
  zim.zimLoopCheck = true;
60603
60600
  if (zot(obj) || zot(call)) return undefined;
@@ -60656,7 +60653,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60656
60653
  r = call(obj.item(i), i, total, start, end, obj, io);
60657
60654
  }
60658
60655
 
60659
- if (r == 'next') io.next();
60656
+ if (r == 'next' && i < total-1) io.next();
60660
60657
  else if (typeof r != 'undefined') {
60661
60658
  io.clear();
60662
60659
  return r;
@@ -60693,7 +60690,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60693
60690
  r = call(obj.item(i), i, total, start, end, obj, io);
60694
60691
  }
60695
60692
 
60696
- if (r == 'next') io.next();
60693
+ if (r == 'next' && i < total-1) io.next();
60697
60694
  else if (typeof r != 'undefined') {
60698
60695
  io.clear();
60699
60696
  return r;
@@ -60727,7 +60724,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60727
60724
 
60728
60725
  r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
60729
60726
 
60730
- if (r == 'next') io.next();
60727
+ if (r == 'next' && i < total-1) io.next();
60731
60728
  else if (typeof r != 'undefined') {
60732
60729
  io.clear();
60733
60730
  return r;
@@ -60748,7 +60745,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60748
60745
 
60749
60746
  r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
60750
60747
 
60751
- if (r == 'next') io.next();
60748
+ if (r == 'next' && i < total-1) io.next();
60752
60749
  else if (typeof r != 'undefined') {
60753
60750
  io.clear();
60754
60751
  return r;
@@ -60768,7 +60765,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60768
60765
  if (typeof r != 'undefined' && r != "next") return r;
60769
60766
  }
60770
60767
  } else {
60771
- zim.interval(interval, function(io) {
60768
+ zim.interval(interval, function(io) {
60772
60769
  i = io.count;
60773
60770
  if (!immediate) i--;
60774
60771
  if (step) i *= step;
@@ -60776,7 +60773,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
60776
60773
 
60777
60774
  r = call(obj.getChildAt(i), i, total, start, end, obj, io);
60778
60775
 
60779
- if (r == 'next') io.next();
60776
+ if (r == 'next' && i < total-1) io.next();
60780
60777
  else if (typeof r != 'undefined') {
60781
60778
  io.clear();
60782
60779
  return r;
@@ -60795,9 +60792,8 @@ RETURNS any value returned from the loop - or true if no value is returned from
60795
60792
  if (!immediate) i--;
60796
60793
  if (step != 1) i = -start + i*step;
60797
60794
 
60798
- r = call(obj.getChildAt(i), i, total, start, end, obj, io);
60799
-
60800
- if (r == 'next') io.next();
60795
+ r = call(obj.getChildAt(i), i, total, start, end, obj, io);
60796
+ if (r == 'next' && i < total-1) io.next();
60801
60797
  else if (typeof r != 'undefined') {
60802
60798
  io.clear();
60803
60799
  return r;
@@ -66673,6 +66669,8 @@ note: the item is not the event object target - as that is the tile
66673
66669
 
66674
66670
  that.spacingH = spacingHList[0];
66675
66671
  that.spacingV = spacingVList[0];
66672
+ if (zot(that.spacingH)) that.spacingH = spacingH;
66673
+ if (zot(that.spacingV)) that.spacingV = spacingV;
66676
66674
 
66677
66675
  // ~~~~~~~~~~~~~~~~~~~ GET ARRAY OF ITEMS ~~~~~~~~~~~~~~~
66678
66676
  // this list could be edited later and passed back into remake()
@@ -90709,12 +90707,12 @@ SVG will give a "ready" and a "complete" event when loaded.
90709
90707
  These events are triggered 20 ms after making the object if the object is already preloaded.
90710
90708
 
90711
90709
  NOTE: SVG is a container with a bitmap inside (see bitmap property)
90712
- or if the bitmap option is not selected there are other shapes inside.
90710
+ or if the bitmap option is not selected there are various shapes inside.
90713
90711
  This means that other objects can be added to the SVG object.
90714
90712
  This is like the ZIM Shapes (Rectangle, Circle, etc.) which are containers and can have objects added to them.
90715
- If doing this, note that the container has its mouseChildren may be turned off
90713
+ If doing this, note that the container has its mouseChildren turned off
90716
90714
  so when dragging, for instance, the whole SVG moves rather than the bitmap inside the SVG.
90717
- To interact with objects inside, set pic.mouseChildren = true.
90715
+ To interact with objects inside, set mySVG.mouseChildren = true.
90718
90716
  Generally, for clarity, avoid adding objects to Shapes, Pics SVGs unless you are used to the mouseChildren setting.
90719
90717
 
90720
90718
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)