void markupEllipse::setArea()
{
    area = rect;
    scalableArea = area;

    // Sanity check - rect should never be non-normallized.
    // Note, drawing a non normalized QRect and a normalized QRect will not draw the same pixels!
    if( rect.width() < 0 || rect.height() < 0 )
    {
        qDebug() << "Error, markupEllipse::setArea() rect has negative dimensions" << rect;
    }

    setLegendOffset( QPoint( 0, 0 ), ABOVE_RIGHT );
    addLegendArea();

    owner->markupAreasStale = true;
}
Beispiel #2
0
void markupText::setArea()
{
    // Set the area to more than enough.
    // This will be trimmed to the bounding retangle of the text
    QSize textSize = owner->legendFontMetrics->size( Qt::TextSingleLine, text );

    rect = QRect( QPoint( 0, 0 ), textSize );

    area = rect;

    scalableArea = QRect( QPoint( 0, 0 ), QPoint( 0, 0 ) );

    //    setLegendPos( rect.topLeft(), ABOVE_RIGHT );  // never draw a legend for text markup
    addLegendArea();

    owner->markupAreasStale = true;

}