summaryrefslogtreecommitdiffstats
path: root/app/gfx/canvas.cc
diff options
context:
space:
mode:
Diffstat (limited to 'app/gfx/canvas.cc')
-rw-r--r--app/gfx/canvas.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/gfx/canvas.cc b/app/gfx/canvas.cc
index 75f8011..75ec0a1 100644
--- a/app/gfx/canvas.cc
+++ b/app/gfx/canvas.cc
@@ -8,6 +8,7 @@
#include "app/gfx/font.h"
#include "app/l10n_util.h"
+#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "gfx/rect.h"
#include "third_party/skia/include/core/SkShader.h"
@@ -218,7 +219,7 @@ void Canvas::DrawStringInt(const std::wstring& text,
const SkColor& color,
int x, int y, int w, int h) {
DrawStringInt(text, font, color, x, y, w, h,
- l10n_util::DefaultCanvasTextAlignment());
+ gfx::Canvas::DefaultCanvasTextAlignment());
}
void Canvas::DrawStringInt(const std::wstring& text,
@@ -267,4 +268,11 @@ SkBitmap Canvas::ExtractBitmap() const {
return result;
}
+// static
+int Canvas::DefaultCanvasTextAlignment() {
+ if (!base::i18n::IsRTL())
+ return gfx::Canvas::TEXT_ALIGN_LEFT;
+ return gfx::Canvas::TEXT_ALIGN_RIGHT;
+}
+
} // namespace gfx