From 8f4cd9c9767f3369b014b840e2c75473ef3f815d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 5 Dec 2014 15:28:54 +0100 Subject: [PATCH] Improve Workspaces Zoom() implementation * Do not move the window, this is annoying * Instead of putting the window at a fixed size, keep the current width and adjust the height so the preview has a correct aspect ratio. Fixes #5034. --- src/apps/workspaces/Workspaces.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp index 5a2d6bdde6..13493a55dd 100644 --- a/src/apps/workspaces/Workspaces.cpp +++ b/src/apps/workspaces/Workspaces.cpp @@ -731,7 +731,7 @@ WorkspacesWindow::Zoom(BPoint origin, float width, float height) uint32 columns, rows; BPrivate::get_workspaces_layout(&columns, &rows); - float workspaceWidth = screenWidth / 10; + float workspaceWidth = Frame().Width() / columns; float workspaceHeight = workspaceWidth / aspectRatio; width = floor(workspaceWidth * columns); @@ -746,12 +746,6 @@ WorkspacesWindow::Zoom(BPoint origin, float width, float height) } ResizeTo(width, height); - - origin = screen.Frame().RightBottom(); - origin.x -= kScreenBorderOffset + width; - origin.y -= kScreenBorderOffset + height; - - MoveTo(origin); }