mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Record whether a callout corresponds to a feature which has all parts labeled in the callout context
This is useful information for dictating how a callout should be rendered
This commit is contained in:
parent
fcd952efe9
commit
bb9267d11b
@ -160,7 +160,7 @@ The default order is QgsCallout.OrderBelowIndividualLabels.
|
||||
|
||||
struct QgsCalloutContext
|
||||
{
|
||||
bool temporary;
|
||||
bool allFeaturePartsLabeled;
|
||||
};
|
||||
|
||||
void render( QgsRenderContext &context, QRectF rect, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext );
|
||||
|
@ -183,9 +183,8 @@ class CORE_EXPORT QgsCallout
|
||||
*/
|
||||
struct CORE_EXPORT QgsCalloutContext
|
||||
{
|
||||
///@cond PRIVATE
|
||||
bool temporary = false; // Temporary member only, required for building on some platforms
|
||||
///@endcond
|
||||
//! TRUE if all parts of associated feature were labeled
|
||||
bool allFeaturePartsLabeled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -305,6 +305,7 @@ void QgsVectorLayerLabelProvider::drawCallout( QgsRenderContext &context, pal::L
|
||||
QgsGeometry g( QgsGeos::fromGeos( label->getFeaturePart()->feature()->geometry() ) );
|
||||
g.transform( xform.transform() );
|
||||
QgsCallout::QgsCalloutContext calloutContext;
|
||||
calloutContext.allFeaturePartsLabeled = label->getFeaturePart()->feature()->labelAllParts();
|
||||
mSettings.callout()->render( context, rect, label->getAlpha() * 180 / M_PI, g, calloutContext );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user