Use current content position when adjusting content size
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 4 Aug 2016 18:41:32 +0000 (11:41 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Thu, 4 Aug 2016 18:41:32 +0000 (11:41 -0700)
atom/browser/native_window.cc

index e345c6e..86a402b 100644 (file)
@@ -219,7 +219,9 @@ gfx::Point NativeWindow::GetPosition() {
 }
 
 void NativeWindow::SetContentSize(const gfx::Size& size, bool animate) {
-  SetSize(ContentBoundsToWindowBounds(gfx::Rect(size)).size(), animate);
+  gfx::Rect bounds = GetContentBounds();
+  bounds.set_size(size);
+  SetSize(ContentBoundsToWindowBounds(bounds).size(), animate);
 }
 
 gfx::Size NativeWindow::GetContentSize() {