Fixed centering and right-justification when combined with left indentation (bug #10221).
Fixed wrapping problem for long lines (bug #10149). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@57001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -107,6 +107,8 @@ All (GUI):
|
||||
before pressing Delete.
|
||||
- Fixed inability to select no superscript and no subscript in wxRichTextCtrl's
|
||||
formatting dialog.
|
||||
- Fixed centering and right-justification when combined with left indentation.
|
||||
- Fixed wrapping problem for long lines.
|
||||
- Fixed wxHTML's pagebreaks computation in tables (D.J.Stauffer).
|
||||
- Fixed wxHtmlWindow::SelectionToText() to correctly insert newlines after
|
||||
single-cell paragraphs.
|
||||
|
@@ -4169,12 +4169,12 @@ void wxRichTextParagraph::ApplyParagraphStyle(const wxTextAttrEx& attr, const wx
|
||||
// centering, right-justification
|
||||
if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
|
||||
{
|
||||
pos.x = (rect.GetWidth() - size.x)/2 + pos.x;
|
||||
pos.x = (rect.GetWidth() - (pos.x - rect.x) - size.x)/2 + pos.x;
|
||||
line->SetPosition(pos);
|
||||
}
|
||||
else if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
|
||||
{
|
||||
pos.x = pos.x + rect.GetWidth() - size.x;
|
||||
pos.x = rect.x + rect.GetWidth() - size.x;
|
||||
line->SetPosition(pos);
|
||||
}
|
||||
|
||||
@@ -4759,7 +4759,7 @@ bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& d
|
||||
widthBefore = 0;
|
||||
|
||||
size_t i;
|
||||
for (i = (size_t) range.GetStart(); i < (size_t) range.GetEnd(); i++)
|
||||
for (i = (size_t) range.GetStart(); i <= (size_t) range.GetEnd(); i++)
|
||||
{
|
||||
int widthFromStartOfThisRange = g_GlobalPartialTextExtents[i - GetRange().GetStart()] - widthBefore;
|
||||
|
||||
|
Reference in New Issue
Block a user