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

Unified Diff: ui/gfx/render_text_mac.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix step one more time Created 8 years, 2 months 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
Index: ui/gfx/render_text_mac.cc
diff --git a/ui/gfx/render_text_mac.cc b/ui/gfx/render_text_mac.cc
index 9ee069f1a60a63089c44b9b15dc59cc532c0f541..f2f1ccc5004eebe64817eed323641f1f329067fc 100644
--- a/ui/gfx/render_text_mac.cc
+++ b/ui/gfx/render_text_mac.cc
@@ -232,13 +232,10 @@ void RenderTextMac::ComputeRuns() {
CFArrayRef ct_runs = CTLineGetGlyphRuns(line_);
const CFIndex ct_runs_count = CFArrayGetCount(ct_runs);
- Point offset(GetTextOrigin());
// Skia will draw glyphs with respect to the baseline.
- offset.Offset(0, common_baseline_);
-
- const SkScalar x = SkIntToScalar(offset.x());
- const SkScalar y = SkIntToScalar(offset.y());
- SkPoint run_origin = SkPoint::Make(offset.x(), offset.y());
+ const SkScalar x = SkIntToScalar(GetTextOffset().x());
Peter Kasting 2012/10/31 01:04:41 Nit: FWIW, I had intended to still have a separate
danakj 2012/10/31 16:55:46 Done.
+ const SkScalar y = SkIntToScalar(GetTextOffset().y() + common_baseline_);
+ SkPoint run_origin = SkPoint::Make(x, y);
const CFRange empty_cf_range = CFRangeMake(0, 0);
for (CFIndex i = 0; i < ct_runs_count; ++i) {

Powered by Google App Engine
This is Rietveld 408576698