summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 18:27:34 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 18:27:34 +0000
commit19bebd0304fabb04866125d296399a0c68a1955f (patch)
treecfceb9cc5301244b3b5c2736dfc71e5f0178573d /views
parent40add757a9b8808e2c7b1a542ad41ab192371be4 (diff)
downloadchromium_src-19bebd0304fabb04866125d296399a0c68a1955f.zip
chromium_src-19bebd0304fabb04866125d296399a0c68a1955f.tar.gz
chromium_src-19bebd0304fabb04866125d296399a0c68a1955f.tar.bz2
Fixes bug in View::OnBoundsChange painting the old/new. The code
wasn't adjusting for RTL. BUG=none TEST=none R=ben@chromium.org,davemoore@chromium.org Review URL: http://codereview.chromium.org/6793050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/view.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/views/view.cc b/views/view.cc
index 5494a4e..c94831a 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -1362,13 +1362,24 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) {
if (canvas_.get())
canvas_.reset(gfx::Canvas::CreateCanvas(width(), height(), false));
- if (parent_) {
- parent_->SchedulePaintInRect(previous_bounds);
- parent_->SchedulePaintInRect(bounds_);
- } else {
- // Previous bounds has no meaning to an orphan. This should only happen
- // when the View is a RootView.
- SchedulePaintInRect(gfx::Rect(0, 0, bounds_.width(), bounds_.height()));
+ if (IsVisible()) {
+ if (parent_) {
+ // Paint the old bounds.
+ if (base::i18n::IsRTL()) {
+ gfx::Rect paint_rect = previous_bounds;
+ paint_rect.set_x(parent()->GetMirroredXForRect(paint_rect));
+ parent_->SchedulePaintInRect(paint_rect);
+ } else {
+ parent_->SchedulePaintInRect(previous_bounds);
+ }
+
+ // Then the new.
+ parent_->SchedulePaintInRect(GetMirroredBounds());
+ } else {
+ // Previous bounds has no meaning to an orphan. This should only happen
+ // when the View is a RootView.
+ SchedulePaintInRect(gfx::Rect(0, 0, bounds_.width(), bounds_.height()));
+ }
}
OnBoundsChanged(previous_bounds);