[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/qt5
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 14 09:01:43 UTC 2021
vcl/qt5/Qt5Frame.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 93b50c83b370a6621438ae532f897100b2bf0666
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sun Apr 11 17:21:57 2021 +0200
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Apr 14 11:01:09 2021 +0200
tdf#141623 Qt5+cairo init surface with widget size
The QFont based rendering path directly uses the widgets size to
initialize the QImage buffer image, so do the same for the Cairo
surface, instead of the arbitrarily size of 640x480.
Change-Id: I91326dab67cbbb5e75b78b02c34eaca61ad26482
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113955
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
(cherry picked from commit 91c883e75436210ca8af95df1ca597caeeda8703)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113869
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
(cherry picked from commit 3f204ca2fed7614e1e12180af5ce5bfd88249eb7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113870
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 936216b9de68..6cb4189343a7 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -290,11 +290,11 @@ void Qt5Frame::Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExten
void Qt5Frame::InitQt5SvpGraphics(Qt5SvpGraphics* pQt5SvpGraphics)
{
- int width = 640;
- int height = 480;
+ QSize aSize = m_pQWidget->size() * devicePixelRatioF();
m_pSvpGraphics = pQt5SvpGraphics;
- m_pSurface.reset(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
- m_pSvpGraphics->setSurface(m_pSurface.get(), basegfx::B2IVector(width, height));
+ m_pSurface.reset(
+ cairo_image_surface_create(CAIRO_FORMAT_ARGB32, aSize.width(), aSize.height()));
+ m_pSvpGraphics->setSurface(m_pSurface.get(), basegfx::B2IVector(aSize.width(), aSize.height()));
cairo_surface_set_user_data(m_pSurface.get(), Qt5SvpGraphics::getDamageKey(), &m_aDamageHandler,
nullptr);
}
More information about the Libreoffice-commits
mailing list