mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8809 MultiPlot Snapshot: Use current page for snapshots
This commit is contained in:
parent
a6eda226f4
commit
c41ab07c1a
@ -345,20 +345,29 @@ void RiuMultiPlotBook::renderTo( QPaintDevice* paintDevice )
|
|||||||
int resolution = paintDevice->logicalDpiX();
|
int resolution = paintDevice->logicalDpiX();
|
||||||
double scaling = resolution / static_cast<double>( RiaGuiApplication::applicationResolution() );
|
double scaling = resolution / static_cast<double>( RiaGuiApplication::applicationResolution() );
|
||||||
|
|
||||||
bool firstPage = true;
|
|
||||||
QPainter painter( paintDevice );
|
QPainter painter( paintDevice );
|
||||||
for ( RiuMultiPlotPage* page : m_pages )
|
|
||||||
|
auto pagedDevice = dynamic_cast<QPagedPaintDevice*>( paintDevice );
|
||||||
|
if ( pagedDevice )
|
||||||
{
|
{
|
||||||
if ( !firstPage )
|
bool firstPage = true;
|
||||||
|
for ( RiuMultiPlotPage* page : m_pages )
|
||||||
{
|
{
|
||||||
QPagedPaintDevice* pagedDevice = dynamic_cast<QPagedPaintDevice*>( paintDevice );
|
if ( !firstPage )
|
||||||
if ( pagedDevice )
|
|
||||||
{
|
{
|
||||||
pagedDevice->newPage();
|
pagedDevice->newPage();
|
||||||
}
|
}
|
||||||
|
page->renderTo( &painter, scaling );
|
||||||
|
firstPage = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( m_currentPageIndex < m_pages.size() )
|
||||||
|
{
|
||||||
|
auto page = m_pages[m_currentPageIndex];
|
||||||
|
page->renderTo( &painter, scaling );
|
||||||
}
|
}
|
||||||
page->renderTo( &painter, scaling );
|
|
||||||
firstPage = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user