Enforce cell dimensions on auto-layout cells
Previously, the calculation of cells which are in autoflow layouts was incorrect since it needed to be multiplied by the cellHeight. To have this, we also need to have a fixed cellHeight for these cells. This overrides any cell width and height set on autoflowed layouts and forces it to 4x4pull/573/head
parent
3732f185b4
commit
ee67298092
|
@ -74,12 +74,15 @@ export const HostPage = React.createClass({
|
|||
let autoflowCells = [];
|
||||
|
||||
const cellWidth = 4;
|
||||
const cellHeight = 4;
|
||||
const pageWidth = 12;
|
||||
|
||||
autoflowLayouts.forEach((layout, i) => {
|
||||
layout.cells.forEach((cell, j) => {
|
||||
cell.w = cellWidth;
|
||||
cell.h = cellHeight;
|
||||
cell.x = ((i + j) * cellWidth % pageWidth);
|
||||
cell.y = Math.floor(((i + j) * cellWidth / pageWidth));
|
||||
cell.y = Math.floor(((i + j) * cellWidth / pageWidth)) * cellHeight;
|
||||
autoflowCells = autoflowCells.concat(cell);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue