From ea528ecdb9d2b717bea9b283316e2c694c936fcc Mon Sep 17 00:00:00 2001 From: wandererfan Date: Mon, 14 Oct 2024 20:06:24 -0400 Subject: [PATCH] [TD]fix scaling of large hatch tiles --- src/Mod/TechDraw/Gui/QGIFace.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGIFace.cpp b/src/Mod/TechDraw/Gui/QGIFace.cpp index 6b64a15547..cacd8440f6 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.cpp +++ b/src/Mod/TechDraw/Gui/QGIFace.cpp @@ -387,7 +387,7 @@ void QGIFace::buildPixHatch() return; } - QImage svgImage(SVGSIZEW, SVGSIZEH, QImage::Format_ARGB32); + QImage svgImage(round(wTile), round(hTile), QImage::Format_ARGB32); svgImage.fill(Qt::transparent); QPainter painter(&svgImage); if (svgImage.isNull()) { @@ -398,9 +398,8 @@ void QGIFace::buildPixHatch() m_sharedRender->render(&painter); // convert the QImage into a QPixmap - QPixmap tilePixmap(SVGSIZEW, SVGSIZEH); + QPixmap tilePixmap(round(wTile), round(hTile)); tilePixmap = QPixmap::fromImage(svgImage); - tilePixmap = tilePixmap.scaled(wTile, hTile); if (tilePixmap.isNull()) { Base::Console().Error("QGIF::buildPixHatch - tilePixmap is null\n"); return; @@ -451,7 +450,6 @@ void QGIFace::buildPixHatch() m_imageSvgHatchArea->setPixmap(nothing); m_imageSvgHatchArea->load(fieldPixmap); m_imageSvgHatchArea->centerAt(faceCenter); - }