]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextctrl.cpp
No real changes, just use wxString::clear() instead of assignment.
[wxWidgets.git] / src / richtext / richtextctrl.cpp
index fc7062ec4448f765c7e40b00920d60cf6db08771..044d3c237698dc13b05a0a3b2b2c0be259e827b2 100644 (file)
@@ -438,9 +438,6 @@ void wxRichTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
 
         dc.SetFont(GetFont());
 
-        // Paint the background
-        PaintBackground(dc);
-
         wxRect drawingArea(GetUpdateRegion().GetBox());
         drawingArea.SetPosition(GetUnscaledPoint(GetLogicalPoint(drawingArea.GetPosition())));
         drawingArea.SetSize(GetUnscaledSize(drawingArea.GetSize()));
@@ -459,6 +456,9 @@ void wxRichTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
             SetupScrollbars();
         }
 
+        // Paint the background
+        PaintBackground(dc);
+
         wxRect clipRect(availableSpace);
         clipRect.x += GetBuffer().GetLeftMargin();
         clipRect.y += GetBuffer().GetTopMargin();
@@ -3262,7 +3262,7 @@ void wxRichTextCtrl::Replace(long from, long to,
 
     SetSelection(from, to);
 
-    wxRichTextAttr attr = GetDefaultStyle();
+    wxRichTextAttr attr(GetDefaultStyle());
 
     DeleteSelectedContent();
 
@@ -3890,6 +3890,7 @@ bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect)
 
         PrepareDC(dc);
         dc.SetFont(GetFont());
+        dc.SetUserScale(GetScale(), GetScale());
 
         wxRichTextDrawingContext context(& GetBuffer());
         GetBuffer().Defragment(context);
@@ -3897,6 +3898,8 @@ bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect)
         GetBuffer().Layout(dc, context, availableSpace, availableSpace, flags);
         GetBuffer().Invalidate(wxRICHTEXT_NONE);
 
+        dc.SetUserScale(1.0, 1.0);
+
         if (!IsFrozen() && !onlyVisibleRect)
             SetupScrollbars();
     }