Skip to content

Commit

Permalink
Replace QMatrix with QTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Sep 16, 2021
1 parent 3d52064 commit 3761ed3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ void createCandidateAtOrderedPositionOverPoint( double &labelX, double &labelY,

// Take care of the label angle when creating candidates. See pr comments #44944 for details
// https://github.com/qgis/QGIS/pull/44944#issuecomment-914670088
QMatrix transformMatrix;
transformMatrix.rotate( angle * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::AngleRadians, QgsUnitTypes::AngleDegrees ) );
transformMatrix.map( deltaX, deltaY, &deltaX, &deltaY );
QTransform transformRotation;
transformRotation.rotate( angle * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::AngleRadians, QgsUnitTypes::AngleDegrees ) );
transformRotation.map( deltaX, deltaY, &deltaX, &deltaY );

//have bearing, distance - calculate reference point
double referenceX = std::cos( alpha ) * distanceToLabel + x;
Expand Down Expand Up @@ -690,9 +690,9 @@ std::size_t FeaturePart::createCandidatesAroundPoint( double x, double y, std::v

// Take care of the label angle when creating candidates. See pr comments #44944 for details
// https://github.com/qgis/QGIS/pull/44944#issuecomment-914670088
QMatrix transformMatrix;
transformMatrix.rotate( angle * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::AngleRadians, QgsUnitTypes::AngleDegrees ) );
transformMatrix.map( deltaX, deltaY, &deltaX, &deltaY );
QTransform transformRotation;
transformRotation.rotate( angle * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::AngleRadians, QgsUnitTypes::AngleDegrees ) );
transformRotation.map( deltaX, deltaY, &deltaX, &deltaY );

double labelX = x + deltaX;
double labelY = y + deltaY;
Expand Down

0 comments on commit 3761ed3

Please sign in to comment.