@overtone-art/canvas-editor-core 0.6.0 → 0.6.1

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/dist/index.js CHANGED
@@ -2043,11 +2043,21 @@ var TextCurveManager = class {
2043
2043
  if (!curve) return false;
2044
2044
  return this.apply(layerId, curve, save);
2045
2045
  }
2046
- /** Rebuild every curved layer — used after a state restore. */
2046
+ /**
2047
+ * Rebuild every curved layer — used after a state restore.
2048
+ *
2049
+ * `getAll` is the canvas stack, so this walks each group's children too:
2050
+ * curved text inside a group would otherwise keep the path geometry it was
2051
+ * restored with, and stop tracking its own text, font and size.
2052
+ */
2047
2053
  refreshAll() {
2048
- for (const layer of this.layers.getAll()) {
2049
- if (layer.meta.curve) this.refresh(layer.id);
2050
- }
2054
+ const visit = (layers) => {
2055
+ for (const layer of layers) {
2056
+ if (layer.meta.curve) this.refresh(layer.id);
2057
+ if (layer.children.length > 0) visit(layer.children);
2058
+ }
2059
+ };
2060
+ visit(this.layers.getAll());
2051
2061
  }
2052
2062
  /**
2053
2063
  * Puts every line's path on the object as one shape, and hooks per-line