entite are not growing while we zoom in terrain de vie
This commit is contained in:
parent
0acad592e7
commit
e88a4c30a7
@ -152,9 +152,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// canvasMap (n, o) {
|
|
||||||
// console.log("concernementItem watch canvasMap", o, n);
|
|
||||||
// }
|
|
||||||
canvasMap: {
|
canvasMap: {
|
||||||
handler (n, o){
|
handler (n, o){
|
||||||
// console.log("concernementItem watch canvasMap.ctx", typeof this.canvas, o, n);
|
// console.log("concernementItem watch canvasMap.ctx", typeof this.canvas, o, n);
|
||||||
@ -710,16 +707,21 @@ export default {
|
|||||||
},
|
},
|
||||||
updateDetailsZoomScale(){
|
updateDetailsZoomScale(){
|
||||||
console.log(`updateDetailsZoomScale ${this.detailsZoomValue}`);
|
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);
|
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
|
// compute the zoom scale
|
||||||
this.details_zoom_scale = this.scale * this.detailsZoomValue;
|
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);
|
this.paper_main_object.scale(this.details_zoom_scale);
|
||||||
// // handle superposition scaling
|
// resize entites (dim them while we zoomin)
|
||||||
// this.resetSuperpositionsConstraintsScaling(s);
|
this.paper_main_object.children['entites'].children.forEach((entite) => {
|
||||||
|
// revert to the original size (by reverting the previous scale)
|
||||||
// this.prev_scale = this.scale = s;
|
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
|
// allow to go through walls if zoomed in
|
||||||
if (this.detailsZoomValue > 1) {
|
if (this.detailsZoomValue > 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user