Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 8, 2022
1 parent 5093ae9 commit 0e5e393
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/labeling/qgsvectorlayerlabelprovider.cpp
Expand Up @@ -599,11 +599,11 @@ void QgsVectorLayerLabelProvider::drawLabelPrivate( pal::LabelPosition *label, Q
for ( int blockIndex = 0; blockIndex < blockCount; ++blockIndex )
{
const double blockBaseLine = metrics.baselineOffset( blockIndex, Qgis::TextLayoutMode::Labeling );
painter->drawLine( QPointF( rect.left(), rect.top() + blockBaseLine ), QPointF( rect.right(), rect.top() + blockBaseLine ) );
painter->drawLine( QPointF( rect.left(), rect.top() + blockBaseLine ),
QPointF( rect.right(), rect.top() + blockBaseLine ) );
}
}


painter->restore();
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/labelposition.cpp
Expand Up @@ -546,7 +546,7 @@ const GEOSPreparedGeometry *LabelPosition::preparedOuterBoundsGeom() const

double LabelPosition::getDistanceToPoint( double xp, double yp, bool useOuterBounds ) const
{
// this method considers the label's outer bounds
// this method may consider the label's outer bounds!

GEOSContextHandle_t geosctxt = QgsGeos::getGEOSHandler();

Expand Down
4 changes: 4 additions & 0 deletions src/core/pal/labelposition.h
Expand Up @@ -138,6 +138,10 @@ namespace pal

/**
* Gets distance from this label to a point. If point lies inside, returns negative number.
*
* If \a useOuterBounds is TRUE then the distance will be calculated to the outer bounds
* of the label (see QgsLabelFeature::outerBounds()), otherwise it will be calculated
* to the label's actual rectangle.
*/
double getDistanceToPoint( double xp, double yp, bool useOuterBounds ) const;

Expand Down

0 comments on commit 0e5e393

Please sign in to comment.