From: Cheng Zhao Date: Mon, 5 Oct 2015 12:03:43 +0000 (+0800) Subject: views: Use the quicker way of return content size X-Git-Tag: v0.33.7~26^2~4^2~15 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a9b0111c3e312d5797d1d4e5e64447f50e856467;p=electron.git views: Use the quicker way of return content size Converting content size to window size on high DPI systems will lose percise and have 1px offset sometimes. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index fdcbe422..0264ac59 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -442,6 +442,10 @@ gfx::Rect NativeWindowViews::GetBounds() { return window_->GetWindowBoundsInScreen(); } +gfx::Size NativeWindowViews::GetContentSize() { + return web_view_->size(); +} + void NativeWindowViews::SetResizable(bool resizable) { #if defined(OS_WIN) // WS_MAXIMIZEBOX => Maximize button diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 0e744108..1ba02e89 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -63,6 +63,7 @@ class NativeWindowViews : public NativeWindow, bool IsFullscreen() const override; void SetBounds(const gfx::Rect& bounds) override; gfx::Rect GetBounds() override; + gfx::Size GetContentSize() override; void SetResizable(bool resizable) override; bool IsResizable() override; void SetAlwaysOnTop(bool top) override;