Pattern shading refactoring

This commit is contained in:
Jakub Melka
2019-08-31 15:55:59 +02:00
parent 36a071886b
commit 31eae284c2
7 changed files with 151 additions and 49 deletions

View File

@ -370,20 +370,16 @@ PDFMesh PDFAxialShading::createMesh(const PDFMeshQualitySettings& settings) cons
}
// Create background color triangles
// TODO: Create background color for axial shading
// Transform mesh to the device space coordinates
mesh.transform(p1p2LCS);
// Transform mesh from the device space coordinates to user space coordinates
Q_ASSERT(settings.userSpaceToDeviceSpaceMatrix.isInvertible());
QMatrix deviceSpaceToUserSpaceMatrix = settings.userSpaceToDeviceSpaceMatrix.inverted();
mesh.transform(deviceSpaceToUserSpaceMatrix);
// Create bounding path
if (m_boundingBox.isValid())
{
QPainterPath boundingPath;
boundingPath.addRect(m_boundingBox);
boundingPath.addPolygon(settings.userSpaceToDeviceSpaceMatrix.map(m_boundingBox));
mesh.setBoundingPath(boundingPath);
}