diff --git a/lib/timeline/Core.js b/lib/timeline/Core.js index deed13c6d4..8adbd044d1 100644 --- a/lib/timeline/Core.js +++ b/lib/timeline/Core.js @@ -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; diff --git a/lib/timeline/component/Component.js b/lib/timeline/component/Component.js index a382491777..66b7d88aae 100644 --- a/lib/timeline/component/Component.js +++ b/lib/timeline/component/Component.js @@ -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; diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index 3abcc0fba5..3913bc9f32 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -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); }