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) {