Skip to content

Commit 5681ee5

Browse files
committed
Use current content position when adjusting content size
1 parent a190495 commit 5681ee5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

atom/browser/native_window.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ gfx::Point NativeWindow::GetPosition() {
219219
}
220220

221221
void NativeWindow::SetContentSize(const gfx::Size& size, bool animate) {
222-
SetSize(ContentBoundsToWindowBounds(gfx::Rect(size)).size(), animate);
222+
gfx::Rect bounds = GetContentBounds();
223+
bounds.set_size(size);
224+
SetSize(ContentBoundsToWindowBounds(bounds).size(), animate);
223225
}
224226

225227
gfx::Size NativeWindow::GetContentSize() {

0 commit comments

Comments
 (0)