Diffstat (limited to 'noncore/graphics/drawpad/drawpadcanvas.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 025bebb..dec498b 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -181,9 +181,11 @@ void DrawPadCanvas::load(QIODevice* ioDevice) m_pages = drawPadCanvasXmlHandler.pages(); if (m_pages.isEmpty()) { - m_pages.append(new Page("", contentsRect().size())); + m_pages.append(new Page("", + clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), + clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); m_pages.current()->pixmap()->fill(Qt::white); } resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); @@ -193,9 +195,13 @@ void DrawPadCanvas::load(QIODevice* ioDevice) } void DrawPadCanvas::initialPage() { - m_pages.append(new Page("", 236, 232)); + m_pages.append(new Page("", + clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), + clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); + //236, 232)); no more fixed sizes + m_pages.current()->pixmap()->fill(Qt::white); resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); viewport()->update(); @@ -348,9 +354,12 @@ void DrawPadCanvas::selectPage(uint pagePosition) void DrawPadCanvas::deleteAll() { m_pages.clear(); - m_pages.append(new Page("", contentsRect().size())); + m_pages.append(new Page("", + clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), + clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); + m_pages.current()->pixmap()->fill(Qt::white); resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); viewport()->update(); @@ -381,9 +390,12 @@ void DrawPadCanvas::deletePage() { m_pages.remove(m_pages.current()); if (m_pages.isEmpty()) { - m_pages.append(new Page("", contentsRect().size())); + m_pages.append(new Page("", + clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), + clipper()->height()+(horizontalScrollBar()->isVisible()?horizontalScrollBar()->height():0))); + m_pages.current()->pixmap()->fill(Qt::white); } resizeContents(m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); |