Corrected top-level object layout in paragraphs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-05-07 15:47:23 +00:00
parent a70eb13eb2
commit 20d09da5f8

View File

@@ -4793,6 +4793,12 @@ bool wxRichTextParagraph::Layout(wxDC& dc, wxRichTextDrawingContext& context, co
}
while (doLoop);
if (child->IsTopLevel())
{
// We can move it to the correct position at this point
child->Move(GetPosition() + wxPoint(currentWidth, currentPosition.y));
}
// Cases:
// 1) There was a line break BEFORE the natural break
// 2) There was a line break AFTER the natural break
@@ -4807,12 +4813,6 @@ bool wxRichTextParagraph::Layout(wxDC& dc, wxRichTextDrawingContext& context, co
)
{
if (child->IsTopLevel())
{
// We can move it to the correct position at this point
child->Move(GetPosition() + wxPoint(currentWidth, currentPosition.y));
}
long wrapPosition = 0;
if ((childSize.x + currentWidth <= availableRect.width) && !node->GetNext() && !lineBreakInThisObject)
wrapPosition = child->GetRange().GetEnd();
@@ -10334,7 +10334,7 @@ bool wxRichTextImage::LoadImageCache(wxDC& dc, bool resetCache)
}
/// Draw the item
bool wxRichTextImage::Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int WXUNUSED(descent), int WXUNUSED(style))
bool wxRichTextImage::Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& WXUNUSED(range), const wxRichTextSelection& selection, const wxRect& rect, int WXUNUSED(descent), int WXUNUSED(style))
{
if (!IsShown())
return true;
@@ -10349,12 +10349,6 @@ bool wxRichTextImage::Draw(wxDC& dc, wxRichTextDrawingContext& context, const wx
DrawBoxAttributes(dc, GetBuffer(), attr, wxRect(rect.GetPosition(), GetCachedSize()));
#if 0
int y = rect.y + (rect.height - m_imageCache.GetHeight());
dc.DrawBitmap(m_imageCache, rect.x, y, true);
#endif
wxSize imageSize(m_imageCache.GetWidth(), m_imageCache.GetHeight());
wxRect marginRect, borderRect, contentRect, paddingRect, outlineRect;
marginRect = rect; // outer rectangle, will calculate contentRect