@meta2d/core 1.1.14 → 1.1.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.1.14",
3
+ "version": "1.1.17",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -855,7 +855,12 @@ export class Canvas {
855
855
  case 'z':
856
856
  case 'Z':
857
857
  if (e.ctrlKey || e.metaKey) {
858
- this.undo();
858
+ if (e.shiftKey) {
859
+ this.redo();
860
+ }
861
+ else {
862
+ this.undo();
863
+ }
859
864
  }
860
865
  else if (e.shiftKey) {
861
866
  this.redo();
@@ -4354,12 +4359,20 @@ export class Canvas {
4354
4359
  return;
4355
4360
  }
4356
4361
  if (now - this.lastRender < this.store.options.interval) {
4362
+ if (this.store.options.interval > this.store.options.minFPSNumber && this.store.options.autoFPS) {
4363
+ this.store.options.interval--;
4364
+ this.store.options.animateInterval = this.store.options.interval;
4365
+ }
4357
4366
  if (this.renderTimer) {
4358
4367
  cancelAnimationFrame(this.renderTimer);
4359
4368
  }
4360
4369
  this.renderTimer = requestAnimationFrame(this.render);
4361
4370
  return;
4362
4371
  }
4372
+ else if (now - this.lastRender - this.store.options.interval > 10 && this.store.options.autoFPS && document.visibilityState === 'visible') {
4373
+ this.store.options.interval++;
4374
+ this.store.options.animateInterval = this.store.options.interval;
4375
+ }
4363
4376
  this.renderTimer = undefined;
4364
4377
  this.lastRender = now;
4365
4378
  const offscreenCtx = this.offscreen.getContext('2d');
@@ -7183,6 +7196,7 @@ export class Canvas {
7183
7196
  li.onmousedown = this.stopPropagation;
7184
7197
  li.dataset.i = index + '';
7185
7198
  li.onclick = this.selectDropdown;
7199
+ li.ontouchstart = this.selectDropdown;
7186
7200
  const pen = this.store.pens[this.inputDiv.dataset.penId];
7187
7201
  li.onmouseenter = () => {
7188
7202
  li.style.background = pen.dropdownHoverBackground || this.store.styles["activeBg"] || '#eee';
@@ -7195,6 +7209,7 @@ export class Canvas {
7195
7209
  this.dropdown.appendChild(li);
7196
7210
  }
7197
7211
  selectDropdown = (e) => {
7212
+ e.stopPropagation();
7198
7213
  const li = e.target;
7199
7214
  const pen = this.store.pens[this.inputDiv.dataset.penId];
7200
7215
  if (!li || !pen || !pen.dropdownList) {