Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: ui/gfx/canvas_skia.cc

Issue 11293194: ui: Prefer +/- operators to apply offsets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: floats Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« .gitmodules ('K') | « ui/gfx/blit.cc ('k') | ui/gfx/pango_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia.cc
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index baa4db9133bf64c63a5f80d39367130315bee4d3..ece6e988f66bbd7c0a331b603d8db2d4b08cc5dc 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -288,7 +288,7 @@ void Canvas::DrawStringWithShadows(const string16& text,
if (i == 0) {
// TODO(msw|asvitkine): Support multi-line text with varied heights.
const int aggregate_height = strings.size() * line_height;
- rect.Offset(0, (text_bounds.height() - aggregate_height) / 2);
+ rect += gfx::Vector2d(0, (text_bounds.height() - aggregate_height) / 2);
}
#endif
@@ -297,7 +297,7 @@ void Canvas::DrawStringWithShadows(const string16& text,
ApplyUnderlineStyle(range, render_text.get());
render_text->SetDisplayRect(rect);
render_text->Draw(this);
- rect.Offset(0, line_height);
+ rect += gfx::Vector2d(0, line_height);
}
} else {
ui::Range range = StripAcceleratorChars(flags, &adjusted_text);
@@ -327,7 +327,7 @@ void Canvas::DrawStringWithShadows(const string16& text,
const int line_height = render_text->GetStringSize().height();
// Center the text vertically.
- rect.Offset(0, (text_bounds.height() - line_height) / 2);
+ rect += gfx::Vector2d(0, (text_bounds.height() - line_height) / 2);
rect.set_height(line_height);
render_text->SetDisplayRect(rect);
@@ -446,7 +446,7 @@ void Canvas::DrawFadeTruncatingString(
const int line_height = render_text->GetStringSize().height();
// Center the text vertically.
- rect.Offset(0, (display_rect.height() - line_height) / 2);
+ rect += gfx::Vector2d(0, (display_rect.height() - line_height) / 2);
rect.set_height(line_height);
render_text->SetDisplayRect(rect);
« .gitmodules ('K') | « ui/gfx/blit.cc ('k') | ui/gfx/pango_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698