Skip to content

Commit

Permalink
[TD]fix scaling of large hatch tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Nov 3, 2024
1 parent 8865450 commit b7bdf93
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Mod/TechDraw/Gui/QGIFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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;
Expand Down Expand Up @@ -451,7 +450,6 @@ void QGIFace::buildPixHatch()
m_imageSvgHatchArea->setPixmap(nothing);
m_imageSvgHatchArea->load(fieldPixmap);
m_imageSvgHatchArea->centerAt(faceCenter);

}


Expand Down

0 comments on commit b7bdf93

Please sign in to comment.