grid for contents in 3 levels ok

This commit is contained in:
2020-09-17 12:47:49 +02:00
parent 8e37e02144
commit 6b1d2f70e5
2 changed files with 54 additions and 26 deletions
+12 -6
View File
@@ -89,6 +89,7 @@ export default {
img_canvas: null,
img_size: { x: 0, y: 0 },
img_position: { x: 0, y: 0, z: 0 },
img_padding: 0.25,
face: null
}),
computed: {
@@ -96,7 +97,8 @@ export default {
projSize: state => state.size,
projPos: state => state.position,
projWall: state => state.wall,
gridContentPlaced: state => state.gridContentPlaced
gridContentPlaced: state => state.gridContentPlaced,
contents_size_factor: state => state.contents_size_factor
}),
color () {
let color = 0x000000
@@ -136,8 +138,8 @@ export default {
}
},
created () {
this.size.x = this.projWall.winW / 2
this.size.y = this.projWall.winY / 2
this.size.x = this.projWall.winW * this.contents_size_factor
this.size.y = this.projWall.winY * this.contents_size_factor
// console.log('ContentBlock created', this.data)
// let txtcolor = '#000000'
// switch (this.type) {
@@ -243,8 +245,8 @@ export default {
.then(({ img, canvas }) => {
// console.log('THEN img loaded ok', this, img, canvas)
let f = this.size.x / canvas.width
this.img_size.x = canvas.width * f
this.img_size.y = this.size.y = canvas.height * f
this.img_size.x = canvas.width * f - this.img_padding * 2
this.img_size.y = this.size.y = canvas.height * f - this.img_padding * 2
console.log(`size.x :${this.size.x}, canvas.width: ${canvas.width}, canvas.height: ${canvas.height}, f: ${f}, img_size.x: ${this.img_size.x}, img_size.y: ${this.img_size.y}`)
this.img_position.y = this.position.y - this.size.y / 2 - this.img_size.y / 2
switch (this.face) {
@@ -298,7 +300,11 @@ export default {
methods: {
...mapInstanceMutations(getModuleName, {
shiftGrid: 'shiftGrid'
})
}),
open () {
this.isOpened = true
// this.loadContents()
}
}
}
</script>