diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 17:18:31 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 17:18:31 +0000 |
commit | cfd5c02d5a9b3bd87042b88cdff5d6b5c9e88f3d (patch) | |
tree | 9a42d34f11610431aeb63149db0b4834f90e3f09 | |
parent | cccaf5c46f01ac94d2c2109e2925586f0ad14b85 (diff) | |
download | chromium_src-cfd5c02d5a9b3bd87042b88cdff5d6b5c9e88f3d.zip chromium_src-cfd5c02d5a9b3bd87042b88cdff5d6b5c9e88f3d.tar.gz chromium_src-cfd5c02d5a9b3bd87042b88cdff5d6b5c9e88f3d.tar.bz2 |
Fixes a drawing bug when scrolling a page with frames on Mac.
http://crbug.com/12237
TEST=Scroll on a page with frames, make sure everything is drawn
correctly.
Review URL: http://codereview.chromium.org/113584
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16385 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_mac.mm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index f49a7db..280cb90 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -219,13 +219,14 @@ void RenderWidgetHostViewMac::DidScrollRect( if (is_hidden_) return; - // Before asking the cocoa view to scroll, shorten the rect's height - // by |dx| pixels if we are scrolling left and shorten its height by - // |dy| pixels if we are scrolling up. This will prevent us from - // moving data beyond the bounds of the original rect, which in turn - // prevents us from accidentally drawing over the scrollbars. + // Before asking the cocoa view to scroll, shorten the rect's bounds + // by the amount we are scrolling. This will prevent us from moving + // data beyond the bounds of the original rect, which in turn + // prevents us from accidentally drawing over other parts of the + // page (scrolbars, other frames, etc). gfx::Rect scroll_rect = rect; - scroll_rect.Inset(0, 0, + scroll_rect.Inset(dx < 0 ? -dx : 0, + dy < 0 ? -dy : 0, dx > 0 ? dx : 0, dy > 0 ? dy : 0); [cocoa_view_ scrollRect:[cocoa_view_ RectToNSRect:scroll_rect] |