| Index: ui/gfx/render_text.cc
|
| diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
|
| index a8246c2d6b1f83905b7092cd9266f2547a179964..4fe3702b9d940f1dd0509841da6bd80f16d55e86 100644
|
| --- a/ui/gfx/render_text.cc
|
| +++ b/ui/gfx/render_text.cc
|
| @@ -406,7 +406,7 @@ void RenderText::SetText(const string16& text) {
|
| void RenderText::SetHorizontalAlignment(HorizontalAlignment alignment) {
|
| if (horizontal_alignment_ != alignment) {
|
| horizontal_alignment_ = alignment;
|
| - display_offset_ = Point();
|
| + display_offset_ = Vector2d();
|
| cached_bounds_and_offset_valid_ = false;
|
| }
|
| }
|
| @@ -765,7 +765,7 @@ RenderText::RenderText()
|
| cached_bounds_and_offset_valid_(false) {
|
| }
|
|
|
| -const Point& RenderText::GetUpdatedDisplayOffset() {
|
| +const Vector2d& RenderText::GetUpdatedDisplayOffset() {
|
| UpdateCachedBoundsAndOffset();
|
| return display_offset_;
|
| }
|
| @@ -847,25 +847,25 @@ Point RenderText::GetTextOrigin() {
|
| }
|
|
|
| Point RenderText::ToTextPoint(const Point& point) {
|
| - return point.Subtract(GetTextOrigin());
|
| + return point.Subtract(GetTextOrigin().DistanceFromOrigin());
|
| }
|
|
|
| Point RenderText::ToViewPoint(const Point& point) {
|
| - return point.Add(GetTextOrigin());
|
| + return point.Add(GetTextOrigin().DistanceFromOrigin());
|
| }
|
|
|
| int RenderText::GetContentWidth() {
|
| return GetStringSize().width() + (cursor_enabled_ ? 1 : 0);
|
| }
|
|
|
| -Point RenderText::GetAlignmentOffset() {
|
| +Vector2d RenderText::GetAlignmentOffset() {
|
| if (horizontal_alignment() != ALIGN_LEFT) {
|
| int x_offset = display_rect().width() - GetContentWidth();
|
| if (horizontal_alignment() == ALIGN_CENTER)
|
| x_offset /= 2;
|
| - return Point(x_offset, 0);
|
| + return Vector2d(x_offset, 0);
|
| }
|
| - return Point();
|
| + return Vector2d();
|
| }
|
|
|
| Point RenderText::GetOriginForDrawing() {
|
| @@ -1001,7 +1001,7 @@ void RenderText::UpdateCachedBoundsAndOffset() {
|
| delta_offset = negate_rtl * (display_width - (content_width + offset));
|
| }
|
|
|
| - display_offset_.Offset(delta_offset, 0);
|
| + display_offset_.Grow(delta_offset, 0);
|
| cursor_bounds_.Offset(delta_offset, 0);
|
| }
|
|
|
|
|