mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash in coloring of ensemble curve sets based on parameter
This commit is contained in:
parent
9a3be356ce
commit
bf9bd6edbc
@ -197,10 +197,17 @@ QRect RiuScalarMapperLegendFrame::labelRect( const LayoutInfo& layout, int index
|
||||
{
|
||||
const int posX = layout.tickEndX + layout.tickTextLeadSpace;
|
||||
|
||||
int posY = layout.colorBarRect.bottom() - layout.tickYPixelPos[index];
|
||||
int posYp1 = layout.colorBarRect.bottom() - layout.tickYPixelPos[index + 1];
|
||||
QString labelI = this->label( index );
|
||||
int width = this->fontMetrics().boundingRect( labelI ).width() + 4;
|
||||
int height = std::min( layout.lineSpacing, std::abs( posY - posYp1 ) );
|
||||
|
||||
int width = this->fontMetrics().boundingRect( labelI ).width() + 4;
|
||||
int height = layout.lineSpacing;
|
||||
|
||||
int posY = layout.colorBarRect.bottom() - layout.tickYPixelPos[index];
|
||||
|
||||
if ( index + 1 < labelCount() )
|
||||
{
|
||||
int posYp1 = layout.colorBarRect.bottom() - layout.tickYPixelPos[index + 1];
|
||||
height = std::min( height, std::abs( posY - posYp1 ) );
|
||||
}
|
||||
return QRect( posX, posY - height / 2, width, height );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user