From e88a4c30a77aea5b5fdcd7b3a2a1e51963a94c0d Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 6 Feb 2024 15:35:46 +0100 Subject: [PATCH] entite are not growing while we zoom in terrain de vie --- src/components/ConcernementMapItem.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/ConcernementMapItem.vue b/src/components/ConcernementMapItem.vue index fa4af0a..5fbfa58 100644 --- a/src/components/ConcernementMapItem.vue +++ b/src/components/ConcernementMapItem.vue @@ -152,9 +152,6 @@ export default { } }, watch: { - // canvasMap (n, o) { - // console.log("concernementItem watch canvasMap", o, n); - // } canvasMap: { handler (n, o){ // console.log("concernementItem watch canvasMap.ctx", typeof this.canvas, o, n); @@ -710,16 +707,21 @@ export default { }, updateDetailsZoomScale(){ console.log(`updateDetailsZoomScale ${this.detailsZoomValue}`); - // revert to the original scale (by reverting the previous scale) + // revert to the original size (by reverting the previous scale) this.paper_main_object.scale(1 / this.details_zoom_scale); + // compute intial entite scale before computing new details_zoom_scale + let prev_entite_s = 1 / this.details_zoom_scale; // compute the zoom scale this.details_zoom_scale = this.scale * this.detailsZoomValue; - // then scale again to new scale + // then scale again to new size this.paper_main_object.scale(this.details_zoom_scale); - // // handle superposition scaling - // this.resetSuperpositionsConstraintsScaling(s); - - // this.prev_scale = this.scale = s; + // resize entites (dim them while we zoomin) + this.paper_main_object.children['entites'].children.forEach((entite) => { + // revert to the original size (by reverting the previous scale) + entite.scale(1 / prev_entite_s); + // then scale again to new size + entite.scale(1 / this.details_zoom_scale); + }); // allow to go through walls if zoomed in if (this.detailsZoomValue > 1) {