@leapfrog/interactive-canvas 2.0.25-beta-16 → 2.0.25-beta-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.
@@ -270,7 +270,7 @@ class StackObjectsLayoutFunction {
270
270
  const footerObjects = objects[0];
271
271
  const bodyObjects = objects[1];
272
272
  const bodyWidth = canvasDimensions.widthPx - canvasMargin.right - canvasMargin.left;
273
- // canvas.redraw();
273
+ canvas.redraw();
274
274
  //Make one pass and set the widths of all elements. This will force objects with dynamic heights (like text) to take on their necessary height before trying to lay them out.
275
275
  this.applyWidths(allObjects, bodyWidth);
276
276
  const bodyRows = this.getRows(bodyObjects);
@@ -518,6 +518,7 @@ class StandardLayoutManager extends AbstractLayoutManager {
518
518
  * @override
519
519
  */
520
520
  onCanvasDimensionsChange() {
521
+ this.stackObjects.execute(this.canvas);
521
522
  this.repositionCutoffs.execute(this.canvas);
522
523
  this.repositionBorders.execute(this.canvas);
523
524
  this.repositionBackgrounds.execute(this.canvas);
@@ -541,19 +542,12 @@ class StandardLayoutManager extends AbstractLayoutManager {
541
542
  this.stackAndRedraw();
542
543
  }
543
544
  stackAndRedraw() {
544
- if (this.layoutBatchScheduled) {
545
- return;
546
- }
547
- this.layoutBatchScheduled = true;
548
- Promise.resolve().then(() => {
549
- this.stackObjects.execute(this.canvas);
550
- this.repositionCutoffs.execute(this.canvas);
551
- this.repositionBorders.execute(this.canvas);
552
- this.repositionBackgrounds.execute(this.canvas);
553
- this.updateObjectDimensions.execute(this.canvas);
554
- this.redrawAll.execute(this.canvas);
555
- this.layoutBatchScheduled = false;
556
- });
545
+ this.stackObjects.execute(this.canvas);
546
+ this.repositionCutoffs.execute(this.canvas);
547
+ this.repositionBorders.execute(this.canvas);
548
+ this.repositionBackgrounds.execute(this.canvas);
549
+ this.updateObjectDimensions.execute(this.canvas);
550
+ this.redrawAll.execute(this.canvas);
557
551
  }
558
552
  }
559
553
 
@@ -291,7 +291,7 @@ class StackObjectsLayoutFunction {
291
291
  const footerObjects = objects[0];
292
292
  const bodyObjects = objects[1];
293
293
  const bodyWidth = canvasDimensions.widthPx - canvasMargin.right - canvasMargin.left;
294
- // canvas.redraw();
294
+ canvas.redraw();
295
295
  //Make one pass and set the widths of all elements. This will force objects with dynamic heights (like text) to take on their necessary height before trying to lay them out.
296
296
  this.applyWidths(allObjects, bodyWidth);
297
297
  const bodyRows = this.getRows(bodyObjects);
@@ -539,6 +539,7 @@ class StandardLayoutManager extends AbstractLayoutManager {
539
539
  * @override
540
540
  */
541
541
  onCanvasDimensionsChange() {
542
+ this.stackObjects.execute(this.canvas);
542
543
  this.repositionCutoffs.execute(this.canvas);
543
544
  this.repositionBorders.execute(this.canvas);
544
545
  this.repositionBackgrounds.execute(this.canvas);
@@ -562,19 +563,12 @@ class StandardLayoutManager extends AbstractLayoutManager {
562
563
  this.stackAndRedraw();
563
564
  }
564
565
  stackAndRedraw() {
565
- if (this.layoutBatchScheduled) {
566
- return;
567
- }
568
- this.layoutBatchScheduled = true;
569
- Promise.resolve().then(() => {
570
- this.stackObjects.execute(this.canvas);
571
- this.repositionCutoffs.execute(this.canvas);
572
- this.repositionBorders.execute(this.canvas);
573
- this.repositionBackgrounds.execute(this.canvas);
574
- this.updateObjectDimensions.execute(this.canvas);
575
- this.redrawAll.execute(this.canvas);
576
- this.layoutBatchScheduled = false;
577
- });
566
+ this.stackObjects.execute(this.canvas);
567
+ this.repositionCutoffs.execute(this.canvas);
568
+ this.repositionBorders.execute(this.canvas);
569
+ this.repositionBackgrounds.execute(this.canvas);
570
+ this.updateObjectDimensions.execute(this.canvas);
571
+ this.redrawAll.execute(this.canvas);
578
572
  }
579
573
  }
580
574
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapfrog/interactive-canvas",
3
- "version": "2.0.25-beta-16",
3
+ "version": "2.0.25-beta-17",
4
4
  "description": "Leapfrog interactive canvas",
5
5
  "files": [
6
6
  "dist"