MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / drawBackground

Method drawBackground

3rdparty/qcustomplot/qcustomplot.cpp:15798–15818  ·  view source on GitHub ↗

! \internal Draws the viewport background pixmap of the plot. If a pixmap was provided via \ref setBackground, this function buffers the scaled version depending on \ref setBackgroundScaled and \ref setBackgroundScaledMode and then draws it inside the viewport with the provided \a painter. The scaled version is buffered in mScaledBackgroundPixmap to prevent expensive rescaling at e

Source from the content-addressed store, hash-verified

15796 \see setBackground, setBackgroundScaled, setBackgroundScaledMode
15797*/
15798void QCustomPlot::drawBackground(QCPPainter *painter)
15799{
15800 // Note: background color is handled in individual replot/save functions
15801
15802 // draw background pixmap (on top of fill, if brush specified):
15803 if (!mBackgroundPixmap.isNull())
15804 {
15805 if (mBackgroundScaled)
15806 {
15807 // check whether mScaledBackground needs to be updated:
15808 QSize scaledSize(mBackgroundPixmap.size());
15809 scaledSize.scale(mViewport.size(), mBackgroundScaledMode);
15810 if (mScaledBackgroundPixmap.size() != scaledSize)
15811 mScaledBackgroundPixmap = mBackgroundPixmap.scaled(mViewport.size(), mBackgroundScaledMode, Qt::SmoothTransformation);
15812 painter->drawPixmap(mViewport.topLeft(), mScaledBackgroundPixmap, QRect(0, 0, mViewport.width(), mViewport.height()) & mScaledBackgroundPixmap.rect());
15813 } else
15814 {
15815 painter->drawPixmap(mViewport.topLeft(), mBackgroundPixmap, QRect(0, 0, mViewport.width(), mViewport.height()));
15816 }
15817 }
15818}
15819
15820/*! \internal
15821

Callers

nothing calls this directly

Calls 4

QRectClass · 0.85
QPointClass · 0.85
isNullMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected