diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index d7289bcdde..9a2cf806d0 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -12267,8 +12267,6 @@ bool wxRichTextImage::LoadImageCache(wxDC& dc, wxRichTextDrawingContext& context { if (buffer) { - // Surely margins will already be accounted for? -#if 0 // Find the actual space available when margin is taken into account wxRect marginRect, borderRect, contentRect, paddingRect, outlineRect; marginRect = wxRect(0, 0, sz.x, sz.y); @@ -12277,7 +12275,7 @@ bool wxRichTextImage::LoadImageCache(wxDC& dc, wxRichTextDrawingContext& context buffer->GetBoxRects(dc, buffer, GetParent()->GetParent()->GetAttributes(), marginRect, borderRect, contentRect, paddingRect, outlineRect); sz = contentRect.GetSize(); } -#endif + // Use a minimum size to stop images becoming very small parentWidth = wxMax(100, sz.GetWidth()); parentHeight = wxMax(100, sz.GetHeight());