Commit b7f5cc27 authored by Craig Watson's avatar Craig Watson

Added sceneSize function to UBGraphicsScene

parent 5d48d55c
......@@ -2257,6 +2257,24 @@ QSize UBGraphicsScene::nominalSize()
return mNominalSize;
}
/**
* @brief Return the scene's boundary size, including any background item
*
* If no background item is present, this returns nominalSize()
*/
QSize UBGraphicsScene::sceneSize()
{
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(backgroundObject());
if (pdfItem) {
QRectF targetRect = pdfItem->sceneBoundingRect();
return targetRect.size().toSize();
}
else
return nominalSize();
}
void UBGraphicsScene::setNominalSize(const QSize& pSize)
{
if (nominalSize() != pSize)
......
......@@ -277,6 +277,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
QSize nominalSize();
QSize sceneSize();
void setNominalSize(const QSize& pSize);
void setNominalSize(int pWidth, int pHeight);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment