jbaysolutions / vue-grid-layout

A draggable and resizable grid layout, for Vue.js.
https://jbaysolutions.github.io/vue-grid-layout/
MIT License
7.1k stars 1.5k forks source link

Grid item heigth not the actual amount of pixels as described in the documentation #776

Open SamGeens opened 1 year ago

SamGeens commented 1 year ago

Software version (please complete the following information):

Describe the bug The grid item height isn't the actual amount of pixels as discribed in the documentation. According to the documentation the grid item heigth should be:

h
type: Number
required: true
Says what is a initial height of the item.

The value is a number that is multiplied by rowHeight.

To Reproduce Steps to reproduce the behavior:

  1. Go to CodeSandbox Template
  2. Note that the row height is set to 30
  3. Inspect the grid elements and note that the item height isn't correct.

*The item heigth is here 72px while the expected heigth is: 30 2 = 60** image

*The item heigth is here 112px while the expected heigth is: 30 3 = 90** image

*The item heigth is here 152px while the expected heigth is: 30 4 = 120** image

Expected behavior I expect the item height to be the actual calcalution the documentation describes: The value is a number that is multiplied by rowHeight

Additional info I wanted to use the row height to calculate what the heigth of and grid element should be before adding it. Let's say I want to add a grid element for a picture I can calculate what the height of the picture should be depending on the grid width to preserve the aspect ratio. If I do such for example the width of a grid item is 100px and I cant to keep a 2x3 ratio the of the grid height should be 150px. But when I set a row height of 1px and a grid item height of 150 the actual height of the grid element is always a bit of like described in step 3.

Freeandeasy101 commented 1 year ago

hello Has the problem been resolved?

LovelyShiba commented 12 months ago

hello Has the problem been resolved?

ModyQyW commented 4 months ago

https://github.com/jbaysolutions/vue-grid-layout/issues/596#issuecomment-922170876