File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 727
727
* Given a height and width in pixel values, calculate grid units.
728
728
* @param {Number} height Height in pixels.
729
729
* @param {Number} width Width in pixels.
730
+ * @param {Boolean} autoSizeFlag function autoSize identifier.
730
731
* @return {Object} w, h as grid units.
731
732
*/
732
- calcWH (height , width ) {
733
+ calcWH (height , width , autoSizeFlag = false ) {
733
734
const colWidth = this .calcColWidth ();
734
735
735
736
// width = colWidth * w - (margin * (w - 1))
736
737
// ...
737
738
// w = (width + margin) / (colWidth + margin)
738
739
let w = Math .round ((width + this .margin [0 ]) / (colWidth + this .margin [0 ]));
739
- let h = Math .round ((height + this .margin [1 ]) / (this .rowHeight + this .margin [1 ]));
740
+ let h = 0 ;
741
+ if (! autoSizeFlag) {
742
+ h = Math .round ((height + this .margin [1 ]) / (this .rowHeight + this .margin [1 ]));
743
+ } else {
744
+ h = Math .ceil ((height + this .margin [1 ]) / (this .rowHeight + this .margin [1 ]));
745
+ }
740
746
741
747
// Capping
742
748
w = Math .max (Math .min (w, this .cols - this .innerX ), 0 );
843
849
this .previousH = this .innerH ;
844
850
845
851
let newSize= this .$slots .default [0 ].elm .getBoundingClientRect ();
846
- let pos = this .calcWH (newSize .height , newSize .width );
852
+ let pos = this .calcWH (newSize .height , newSize .width , true );
847
853
if (pos .w < this .minW ) {
848
854
pos .w = this .minW ;
849
855
}
You can’t perform that action at this time.
0 commit comments