Fixed bug in border drawing

This commit is contained in:
JulianSmart
2015-10-07 14:40:36 +01:00
parent 965786a0fa
commit 5979facc48

View File

@@ -979,18 +979,13 @@ bool wxRichTextObject::DrawBorder(wxDC& dc, wxRichTextBuffer* buffer, const wxRi
wxColour col(borders.GetTop().GetColour()); wxColour col(borders.GetTop().GetColour());
wxPenStyle penStyle = wxPENSTYLE_SOLID; wxPenStyle penStyle = wxPENSTYLE_SOLID;
if (borders.GetRight().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DOTTED) if (borders.GetTop().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DOTTED)
penStyle = wxPENSTYLE_DOT; penStyle = wxPENSTYLE_DOT;
else if (borders.GetRight().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DASHED) else if (borders.GetTop().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DASHED)
penStyle = wxPENSTYLE_LONG_DASH; penStyle = wxPENSTYLE_LONG_DASH;
if (borderTop == 1 || penStyle != wxPENSTYLE_SOLID) if (borderTop == 1 || penStyle != wxPENSTYLE_SOLID)
{ {
wxPenStyle penStyle = wxPENSTYLE_SOLID;
if (borders.GetTop().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DOTTED)
penStyle = wxPENSTYLE_DOT;
else if (borders.GetTop().GetStyle() == wxTEXT_BOX_ATTR_BORDER_DASHED)
penStyle = wxPENSTYLE_LONG_DASH;
wxPen pen(col, borderTop, penStyle); wxPen pen(col, borderTop, penStyle);
dc.SetPen(pen); dc.SetPen(pen);
// See note above. // See note above.