Commit 8b7c7881 authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch

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

parent 37d6a040
......@@ -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