author | leseb <leseb> | 2002-04-23 21:24:05 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-04-23 21:24:05 (UTC) |
commit | 0b77115683f1b8d339cdf07755e22d443caf310a (patch) (unidiff) | |
tree | a37ef63fea1b3dbf9f396f7a79030e4d04629952 | |
parent | 7200c56e4ccc6aa83d1a3ef86ddda9470492ab52 (diff) | |
download | opie-0b77115683f1b8d339cdf07755e22d443caf310a.zip opie-0b77115683f1b8d339cdf07755e22d443caf310a.tar.gz opie-0b77115683f1b8d339cdf07755e22d443caf310a.tar.bz2 |
Fix bug when drawing page with size inferior to view size
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index b39a633..65b3dea 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -539,6 +539,16 @@ void DrawPadCanvas::contentsMouseMoveEvent(QMouseEvent* e) | |||
539 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | 539 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) |
540 | { | 540 | { |
541 | QRect clipRect(cx, cy, cw, ch); | 541 | QRect clipRect(cx, cy, cw, ch); |
542 | QRect pixmapRect(0, 0, m_pages.current()->width(), m_pages.current()->height()); | ||
543 | QRect drawRect = pixmapRect.intersect(clipRect); | ||
542 | 544 | ||
543 | p->drawPixmap(clipRect.topLeft(), *(m_pages.current()), clipRect); | 545 | p->drawPixmap(drawRect.topLeft(), *(m_pages.current()), drawRect); |
546 | |||
547 | if (drawRect.right() < clipRect.right()) { | ||
548 | p->fillRect(drawRect.right() + 1, cy, cw - drawRect.width(), ch, colorGroup().dark()); | ||
549 | } | ||
550 | |||
551 | if (drawRect.bottom() < clipRect.bottom()) { | ||
552 | p->fillRect(cx, drawRect.bottom() + 1, cw, ch - drawRect.height(), colorGroup().dark()); | ||
553 | } | ||
544 | } | 554 | } |