Skip to content

Commit

Permalink
fix: issue #17 (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamberk authored Nov 18, 2019
1 parent 46fffca commit cf7bc8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/timeline/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,9 @@ class Core {
const centerContainerClientHeight = dom.centerContainer.clientHeight;

// calculate border widths
props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
props.border.left = Math.floor((dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2);
props.border.right = props.border.left;
props.border.top = (dom.centerContainer.offsetHeight - centerContainerClientHeight) / 2;
props.border.top = Math.floor((dom.centerContainer.offsetHeight - centerContainerClientHeight) / 2);
props.border.bottom = props.border.top;
props.borderRootHeight = rootOffsetHeight - rootClientHeight;
props.borderRootWidth = rootOffsetWidth - dom.root.clientWidth;
Expand Down
6 changes: 4 additions & 2 deletions lib/timeline/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export default class Component {
* @protected
*/
_isResized() {
const resized = (this.props._previousWidth !== this.props.width ||
this.props._previousHeight !== this.props.height);
const resized = (
this.props._previousWidth !== this.props.width ||
this.props._previousHeight !== this.props.height
);

this.props._previousWidth = this.props.width;
this.props._previousHeight = this.props.height;
Expand Down
2 changes: 1 addition & 1 deletion lib/timeline/component/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ class Group {
item.top -= offset;
});
}
height = max + margin.item.vertical / 2;
height = Math.ceil(max + margin.item.vertical / 2);
if (this.heightMode !== "fitItems") {
height = Math.max(height, this.props.label.height);
}
Expand Down

0 comments on commit cf7bc8f

Please sign in to comment.