Index: ui/views/examples/text_example.cc |
=================================================================== |
--- ui/views/examples/text_example.cc (revision 129193) |
+++ ui/views/examples/text_example.cc (working copy) |
@@ -100,23 +100,26 @@ |
} |
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
+ View::OnPaint(canvas); |
+ |
+ const gfx::Rect bounds = GetContentsBounds(); |
+ |
#if defined(OS_WIN) |
if (fade_) { |
size_t characters_to_truncate_from_head = |
gfx::Canvas::TruncateFadeHeadAndTail ? 10 : 0; |
canvas->DrawFadeTruncatingString(text_, fade_mode_, |
- characters_to_truncate_from_head, font_, SK_ColorDKGRAY, |
- GetLocalBounds()); |
+ characters_to_truncate_from_head, font_, SK_ColorDKGRAY, bounds); |
return; |
} |
#endif |
if (halo_) { |
- canvas->DrawStringWithHalo(text_, font_, SK_ColorDKGRAY, SK_ColorWHITE, 0, |
- 0, width(), height(), text_flags_); |
+ canvas->DrawStringWithHalo(text_, font_, SK_ColorDKGRAY, SK_ColorWHITE, |
+ bounds.x(), bounds.y(), bounds.width(), bounds.height(), text_flags_); |
} else { |
- canvas->DrawStringInt(text_, font_, SK_ColorDKGRAY, 0, 0, width(), |
- height(), text_flags_); |
+ canvas->DrawStringInt(text_, font_, SK_ColorDKGRAY, bounds.x(), |
+ bounds.y(), bounds.width(), bounds.height(), text_flags_); |
} |
} |
@@ -198,6 +201,7 @@ |
void TextExample::CreateExampleView(View* container) { |
text_view_ = new TextExampleView; |
+ text_view_->set_border(views::Border::CreateSolidBorder(1, SK_ColorGRAY)); |
GridLayout* layout = new GridLayout(container); |
container->SetLayoutManager(layout); |