mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-29 00:03:59 -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
python/core/auto_generated/callouts
src/core
@ -160,7 +160,7 @@ The default order is QgsCallout.OrderBelowIndividualLabels.
|
|||||||
|
|
||||||
struct QgsCalloutContext
|
struct QgsCalloutContext
|
||||||
{
|
{
|
||||||
bool temporary;
|
bool allFeaturePartsLabeled;
|
||||||
};
|
};
|
||||||
|
|
||||||
void render( QgsRenderContext &context, QRectF rect, const double angle, const QgsGeometry &anchor, QgsCalloutContext &calloutContext );
|
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
|
struct CORE_EXPORT QgsCalloutContext
|
||||||
{
|
{
|
||||||
///@cond PRIVATE
|
//! TRUE if all parts of associated feature were labeled
|
||||||
bool temporary = false; // Temporary member only, required for building on some platforms
|
bool allFeaturePartsLabeled = false;
|
||||||
///@endcond
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -305,6 +305,7 @@ void QgsVectorLayerLabelProvider::drawCallout( QgsRenderContext &context, pal::L
|
|||||||
QgsGeometry g( QgsGeos::fromGeos( label->getFeaturePart()->feature()->geometry() ) );
|
QgsGeometry g( QgsGeos::fromGeos( label->getFeaturePart()->feature()->geometry() ) );
|
||||||
g.transform( xform.transform() );
|
g.transform( xform.transform() );
|
||||||
QgsCallout::QgsCalloutContext calloutContext;
|
QgsCallout::QgsCalloutContext calloutContext;
|
||||||
|
calloutContext.allFeaturePartsLabeled = label->getFeaturePart()->feature()->labelAllParts();
|
||||||
mSettings.callout()->render( context, rect, label->getAlpha() * 180 / M_PI, g, calloutContext );
|
mSettings.callout()->render( context, rect, label->getAlpha() * 180 / M_PI, g, calloutContext );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user