Fix panel width

This commit is contained in:
sienori 2019-02-23 18:44:43 +09:00
parent ba7f3c01e5
commit 13739980f6

View file

@ -86,8 +86,9 @@ export default class TranslatePanel extends Component {
}; };
calcSize = () => { calcSize = () => {
const maxWidth = parseInt(getSettings("width"));
const wrapper = ReactDOM.findDOMNode(this.refs.wrapper); const wrapper = ReactDOM.findDOMNode(this.refs.wrapper);
const wrapperWidth = wrapper.clientWidth; const wrapperWidth = wrapper.clientWidth < maxWidth ? wrapper.clientWidth + 1 : maxWidth;
const wrapperHeight = wrapper.clientHeight; const wrapperHeight = wrapper.clientHeight;
return { panelWidth: wrapperWidth, panelHeight: wrapperHeight }; return { panelWidth: wrapperWidth, panelHeight: wrapperHeight };
}; };