mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-05 11:46:57 +00:00
centerWindowHorizontally: Animate and use whole pixels
This commit is contained in:
@@ -1453,11 +1453,11 @@ function centerWindowHorizontally(metaWindow) {
|
||||
const frame = metaWindow.get_frame_rect();
|
||||
const space = spaces.spaceOfWindow(metaWindow);
|
||||
const monitor = space.monitor;
|
||||
const targetX = (monitor.width/2 - frame.width/2)
|
||||
const targetX = Math.round(monitor.width/2 - frame.width/2);
|
||||
const dx = (targetX + monitor.x) - frame.x;
|
||||
utils.warpPointerRelative(dx, 0);
|
||||
move_to(space, metaWindow, { x: targetX, y: frame.y });
|
||||
space.emit('move-done');
|
||||
move_to(space, metaWindow, { x: targetX, y: frame.y,
|
||||
onComplete: () => space.emit('move-done')});
|
||||
Tweener.removeTweens(space.selection);
|
||||
space.selection.width = frame.width + prefs.window_gap;
|
||||
space.selection.x = targetX + monitor.x - Math.round(prefs.window_gap/2);
|
||||
|
||||
Reference in New Issue
Block a user