Avoid 1px gaps between consecutive underlined words in wxHTML

At least when using standard fonts under MSW, the underlines under the
consecutive words didn't overlap, resulting in ugly gaps between them when
using more than one word as the link text, for example.

Work around this by drawing an extra, slightly offset, underlined space when
the previous cell was drawn underlined.
This commit is contained in:
Vadim Zeitlin
2015-12-03 03:55:52 +01:00
parent 9f15ca5f53
commit 0dc57e9e23
3 changed files with 30 additions and 1 deletions

View File

@@ -125,7 +125,12 @@ public:
class WXDLLIMPEXP_HTML wxHtmlRenderingInfo
{
public:
wxHtmlRenderingInfo() : m_selection(NULL), m_style(NULL) {}
wxHtmlRenderingInfo()
: m_selection(NULL),
m_style(NULL),
m_prevUnderlined(false)
{
}
void SetSelection(wxHtmlSelection *s) { m_selection = s; }
wxHtmlSelection *GetSelection() const { return m_selection; }
@@ -133,12 +138,16 @@ public:
void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; }
wxHtmlRenderingStyle& GetStyle() { return *m_style; }
void SetCurrentUnderlined(bool u) { m_prevUnderlined = u; }
bool WasPreviousUnderlined() const { return m_prevUnderlined; }
wxHtmlRenderingState& GetState() { return m_state; }
protected:
wxHtmlSelection *m_selection;
wxHtmlRenderingStyle *m_style;
wxHtmlRenderingState m_state;
bool m_prevUnderlined;
};