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

Unified Diff: app/gfx/canvas_win.cc

Issue 384018: Added a flag to the Canvas class which allows forcing an RTL directionality... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « app/gfx/canvas.h ('k') | chrome/browser/autocomplete/autocomplete.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/canvas_win.cc
===================================================================
--- app/gfx/canvas_win.cc (revision 31579)
+++ app/gfx/canvas_win.cc (working copy)
@@ -106,12 +106,16 @@
// Caveat: If the string is purely LTR, don't set DTL_RTLREADING since when
// the flag is set, LRE-PDF don't have the desired effect of rendering
// multiline English-only text as LTR.
- if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT &&
- (f & DT_RIGHT)) {
- if (l10n_util::StringContainsStrongRTLChars(text)) {
- f |= DT_RTLREADING;
- }
+ //
+ // Note that if the caller is explicitly requesting displaying the text
+ // using RTL directionality then we respect that and pass DT_RTLREADING to
+ // ::DrawText even if the locale is LTR.
+ if ((flags & gfx::Canvas::FORCE_RTL_DIRECTIONALITY) ||
+ ((l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) &&
+ (f & DT_RIGHT) && l10n_util::StringContainsStrongRTLChars(text))) {
+ f |= DT_RTLREADING;
}
+
return f;
}
« no previous file with comments | « app/gfx/canvas.h ('k') | chrome/browser/autocomplete/autocomplete.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698