From 0d6ca1c2f61ff5f9665edc19d071338c5de4b708 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 23 Sep 2009 07:38:42 +0000 Subject: [PATCH] Fix for wrong line placement when centering or right-aligning git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 4e00843d4b..14fcf89984 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3641,17 +3641,13 @@ void wxRichTextParagraph::ApplyParagraphStyle(const wxTextAttr& attr, const wxRe if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) { int rightIndent = ConvertTenthsMMToPixels(dc, attr.GetRightIndent()); - pos.x = (rect.GetWidth() - (pos.x - rect.x) - rightIndent - size.x)/2 + pos.x; - // Lines are relative to the paragraph position - pos.x -= GetPosition().x; + pos.x = (rect.GetWidth() - pos.x - rightIndent - size.x)/2 + pos.x; line->SetPosition(pos); } else if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_RIGHT) { int rightIndent = ConvertTenthsMMToPixels(dc, attr.GetRightIndent()); - pos.x = rect.x + rect.GetWidth() - size.x - rightIndent; - // Lines are relative to the paragraph position - pos.x -= GetPosition().x; + pos.x = rect.GetWidth() - size.x - rightIndent; line->SetPosition(pos); } -- 2.45.2