diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 6223e5b950..24859551f1 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -36,6 +36,7 @@ #include "wx/textfile.h" #include "wx/hashmap.h" #include "wx/dynarray.h" +#include "wx/math.h" #include "wx/richtext/richtextctrl.h" #include "wx/richtext/richtextstyles.h" @@ -709,7 +710,9 @@ bool wxRichTextObject::DrawBoxAttributes(wxDC& dc, wxRichTextBuffer* buffer, con // Let's pretend our background is always white. Calculate a colour value // from this and the opacity. double p = attr.GetTextBoxAttr().GetShadow().GetOpacity().GetValue() / 100.0; - shadowColour.Set((1.0 - p)*255 + p*shadowColour.Red(), (1.0 - p)*255 + p*shadowColour.Green(), (1.0 - p)*255 + p*shadowColour.Blue()); + shadowColour.Set(wxRound((1.0 - p)*255 + p*shadowColour.Red()), + wxRound((1.0 - p)*255 + p*shadowColour.Green()), + wxRound((1.0 - p)*255 + p*shadowColour.Blue())); } wxRect shadowRect = borderRect; if (attr.GetTextBoxAttr().GetShadow().GetOffsetX().IsValid())