Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] window-size: fix error on loading screen #546

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/background/windowState.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import _ from 'lodash';
export default function (name, defaults) {

const userDataDir = jetpack.cwd(app.getPath('userData'));
const stateStoreFile = 'window-state-' + name +'.json';
const stateStoreFile = `window-state-${name}.json`;
let state = {
width: defaults.width,
height: defaults.height
Expand Down Expand Up @@ -41,10 +41,10 @@ export default function (name, defaults) {
};

return {
get x () { return state.x; },
get y () { return state.y; },
get width () { return state.width; },
get height () { return state.height; },
get x () { return Math.floor(state.x); },
get y () { return Math.floor(state.y); },
get width () { return Math.floor(state.width); },
get height () { return Math.floor(state.height); },
get isMaximized () { return state.isMaximized; },
get isMinimized () { return state.isMinimized; },
get isHidden () { return state.isHidden; },
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export default function (name, options) {
const position = win.getPosition();
const size = win.getSize();
return {
x: position[0],
y: position[1],
width: size[0],
height: size[1]
x: Math.floor(position[0]),
y: Math.floor(position[1]),
width: Math.floor(size[0]),
height: Math.floor(size[1])
};
};

Expand Down