MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / alignLegend

Method alignLegend

3rdparty/qwt/src/qwt_plot_layout.cpp:570–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570QRectF LayoutEngine::alignLegend( const QSize& legendHint,
571 const QRectF& canvasRect, const QRectF& legendRect ) const
572{
573 QRectF alignedRect = legendRect;
574
575 if ( m_legendPos == QwtPlot::BottomLegend
576 || m_legendPos == QwtPlot::TopLegend )
577 {
578 if ( legendHint.width() < canvasRect.width() )
579 {
580 alignedRect.setX( canvasRect.x() );
581 alignedRect.setWidth( canvasRect.width() );
582 }
583 }
584 else
585 {
586 if ( legendHint.height() < canvasRect.height() )
587 {
588 alignedRect.setY( canvasRect.y() );
589 alignedRect.setHeight( canvasRect.height() );
590 }
591 }
592
593 return alignedRect;
594}
595
596int LayoutEngine::heightForWidth(
597 LayoutData::Label labelType, const LayoutData& layoutData,

Callers 1

activateMethod · 0.80

Calls 8

setXMethod · 0.80
heightMethod · 0.80
setYMethod · 0.80
yMethod · 0.80
setHeightMethod · 0.80
widthMethod · 0.45
xMethod · 0.45
setWidthMethod · 0.45

Tested by

no test coverage detected