From a530d4c658f8981cbca1fcedca1e799459ce877a Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Thu, 2 Mar 2023 16:15:18 -0700 Subject: [PATCH] Move updateOrderDependentProperties into QuadrilateralShapeModel and add documentation, see https://github.com/phetsims/quadrilateral/issues/398 --- js/quadrilateral/model/QuadrilateralModel.ts | 6 +----- js/quadrilateral/model/QuadrilateralShapeModel.ts | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/js/quadrilateral/model/QuadrilateralModel.ts b/js/quadrilateral/model/QuadrilateralModel.ts index cbe0f05a..f12c755e 100644 --- a/js/quadrilateral/model/QuadrilateralModel.ts +++ b/js/quadrilateral/model/QuadrilateralModel.ts @@ -167,6 +167,7 @@ export default class QuadrilateralModel implements TModel { this.quadrilateralTestShapeModel.setPropertiesDeferred( false ); // REVIEW: Make isQuadrilateralShapeAllowed static + // REVIEW: After potentially addressing the above, maybe make this method and isVertexPositionAllowed feel more similar??? return this.quadrilateralTestShapeModel.isQuadrilateralShapeAllowed(); } @@ -185,11 +186,6 @@ export default class QuadrilateralModel implements TModel { this.quadrilateralShapeModel.reset(); this.quadrilateralTestShapeModel.reset(); - // Eagerly update the Properties that are set asynchronously, so we don't wait until - // the next frame for these to be set after a reset. - this.quadrilateralShapeModel.updateOrderDependentProperties(); - this.quadrilateralTestShapeModel.updateOrderDependentProperties(); - this.resetEmitter.emit(); // reset is not in progress anymore diff --git a/js/quadrilateral/model/QuadrilateralShapeModel.ts b/js/quadrilateral/model/QuadrilateralShapeModel.ts index 8e73496c..d8b89526 100644 --- a/js/quadrilateral/model/QuadrilateralShapeModel.ts +++ b/js/quadrilateral/model/QuadrilateralShapeModel.ts @@ -680,6 +680,8 @@ export default class QuadrilateralShapeModel { // no longer deferred, invoke callbacks and update order dependent Properties this.setPropertiesDeferred( false ); + + this.updateOrderDependentProperties(); } /**