Help: Fix font point sizes with litehtml

Change-Id: Ia2d7434ed965b00075747c0bdd43d90a236b99dd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2019-09-04 14:20:34 +02:00
parent b6c2277146
commit f5d6eb564b
3 changed files with 11 additions and 1 deletions

View File

@@ -505,7 +505,8 @@ void DocumentContainer::draw_text(litehtml::uint_ptr hdc,
int DocumentContainer::pt_to_px(int pt)
{
return pt;
// magic factor of 11/12 to account for differences to webengine/webkit
return m_paintDevice->physicalDpiY() * pt * 11 / m_paintDevice->logicalDpiY() / 12;
}
int DocumentContainer::get_default_font_size() const
@@ -847,6 +848,11 @@ void DocumentContainer::get_language(litehtml::tstring &language, litehtml::tstr
Q_UNUSED(culture)
}
void DocumentContainer::setPaintDevice(QPaintDevice *paintDevice)
{
m_paintDevice = paintDevice;
}
void DocumentContainer::setScrollPosition(const QPoint &pos)
{
m_scrollPosition = pos;