Diffstat (limited to 'noncore/graphics/drawpad/drawpadcanvas.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 423ef26..5d0c6e4 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -513,17 +513,19 @@ void DrawPadCanvas::contentsMouseMoveEvent(QMouseEvent* e) | |||
513 | { | 513 | { |
514 | m_pDrawPad->tool()->mouseMoveEvent(e); | 514 | m_pDrawPad->tool()->mouseMoveEvent(e); |
515 | } | 515 | } |
516 | 516 | ||
517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | 517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) |
518 | { | 518 | { |
519 | Page* currentPage = m_pages.current(); | ||
520 | if ( !currentPage ) return; // no page yet --> initialization not finished (Mickeyl) | ||
519 | QRect clipRect(cx, cy, cw, ch); | 521 | QRect clipRect(cx, cy, cw, ch); |
520 | QRect pixmapRect(0, 0, m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 522 | QRect pixmapRect(0, 0, currentPage->pixmap()->width(), m_pages.current()->pixmap()->height()); |
521 | QRect drawRect = pixmapRect.intersect(clipRect); | 523 | QRect drawRect = pixmapRect.intersect(clipRect); |
522 | 524 | ||
523 | p->drawPixmap(drawRect.topLeft(), *(m_pages.current()->pixmap()), drawRect); | 525 | p->drawPixmap(drawRect.topLeft(), *(currentPage->pixmap()), drawRect); |
524 | 526 | ||
525 | if (drawRect.right() < clipRect.right()) { | 527 | if (drawRect.right() < clipRect.right()) { |
526 | p->fillRect(drawRect.right() + 1, cy, cw - drawRect.width(), ch, colorGroup().dark()); | 528 | p->fillRect(drawRect.right() + 1, cy, cw - drawRect.width(), ch, colorGroup().dark()); |
527 | } | 529 | } |
528 | 530 | ||
529 | if (drawRect.bottom() < clipRect.bottom()) { | 531 | if (drawRect.bottom() < clipRect.bottom()) { |