Commit 0a880f42 authored by Anton Koch's avatar Anton Koch
Browse files

Merge branch '6-(mosys)-grid-height-fixing' into 'master'

fixed wrong grid height calculating after resizing the viewport (#6)

Closes #6

See merge request !9
parents 37d6a040 8b7c7881
Pipeline #10928 passed with stage
in 19 minutes and 28 seconds
......@@ -106,9 +106,10 @@
if (!this.grid) return
let elWidth = size ? size.width : this.$el.offsetWidth
let elHeight = size ? size.height : this.$el.offsetHeight
// let elHeight = size ? size.height : this.$el.offsetHeight
let cellSizeRatio = this.grid.config.ratio
let gridHeight = elHeight
// let gridHeight = elHeight
let gridHeight = this.$el.offsetHeight
let cellHeight = gridHeight / this.grid.config.rows
let cellWidth = elWidth / Math.round(elWidth / (cellHeight * cellSizeRatio))
let gridWidth = cellWidth * this.grid.config.columns
......
......@@ -502,9 +502,10 @@
if (!this.grid || !this.grid.config) return
let elWidth = size ? size.width : this.$el.offsetWidth
let elHeight = size ? size.height : this.$el.offsetHeight
// let elHeight = size ? size.height : this.$el.offsetHeight
let cellSizeRatio = this.grid.config.ratio
let gridHeight = elHeight
// let gridHeight = elHeight
let gridHeight = this.$el.offsetHeight
let cellHeight = gridHeight / this.grid.config.rows
let cellWidth = elWidth / Math.round(elWidth / (cellHeight * cellSizeRatio))
let gridWidth = cellWidth * this.grid.config.columns
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment