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