Skip to content

Commit

Permalink
fix(layout): user logicalSize when determining component visibility (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
miralemd authored Apr 8, 2019
1 parent 76b3874 commit dfb6a91
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,31 @@ describe('Dock Layout', () => {
height: 1000
});
});

it('should use logicalSize when determining visiblity of components', () => {
const container = createRect(0, 0, 1000, 2000);
const settings = {
layoutModes: {
S: { width: 800, height: 100 }
},
logicalSize: {
x: 0,
y: 0,
width: 799,
height: 100
}
};

const leftComp = componentMock({ dock: 'left', size: 100, minimumLayoutMode: { width: 'S', height: 'S' } });
const mainComp = componentMock();

dl.settings(settings);

const { visible, hidden } = dl.layout(container, [mainComp, leftComp]);

expect(visible).to.include(mainComp);
expect(hidden).to.include(leftComp);
});
});

describe('edgeBleed', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/picasso.js/src/core/layout/dock/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ function dockLayout(initialSettings) {

const { logicalContainerRect, containerRect } = resolveContainerRects(rect, settings);

const [visible, hidden] = filterComponents(components, settings, containerRect);
const [visible, hidden] = filterComponents(components, settings, logicalContainerRect);

const reducedRect = reduceLayoutRect({
layoutRect: logicalContainerRect,
Expand Down

0 comments on commit dfb6a91

Please sign in to comment.