mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Slightly delay background render of layout maps in preview
Avoids incurring the main thread preparation cost many times when resizing a layout window
This commit is contained in:
parent
eabfb8a96d
commit
d9d503a024
@ -1135,13 +1135,13 @@ void QgsLayoutItemMap::paint( QPainter *painter, const QStyleOptionGraphicsItem
|
|||||||
{
|
{
|
||||||
// current job was invalidated - start a new one
|
// current job was invalidated - start a new one
|
||||||
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
||||||
mBackgroundUpdateTimer->start( 1 );
|
mBackgroundUpdateTimer->start( 100 );
|
||||||
}
|
}
|
||||||
else if ( !mPainterJob && !mDrawingPreview )
|
else if ( !mPainterJob && !mDrawingPreview )
|
||||||
{
|
{
|
||||||
// this is the map's very first paint - trigger a cache update
|
// this is the map's very first paint - trigger a cache update
|
||||||
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
||||||
mBackgroundUpdateTimer->start( 1 );
|
mBackgroundUpdateTimer->start( 100 );
|
||||||
}
|
}
|
||||||
renderInProgress = true;
|
renderInProgress = true;
|
||||||
}
|
}
|
||||||
@ -1151,7 +1151,7 @@ void QgsLayoutItemMap::paint( QPainter *painter, const QStyleOptionGraphicsItem
|
|||||||
{
|
{
|
||||||
// cache was invalidated - trigger a background update
|
// cache was invalidated - trigger a background update
|
||||||
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( style, painter );
|
||||||
mBackgroundUpdateTimer->start( 1 );
|
mBackgroundUpdateTimer->start( 100 );
|
||||||
renderInProgress = true;
|
renderInProgress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user