author | leseb <leseb> | 2002-11-14 19:34:55 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-11-14 19:34:55 (UTC) |
commit | 4b28f45cd1f6a72f41219786c7fb411523a6d622 (patch) (side-by-side diff) | |
tree | 1970f579a6e1bb3de20e0cb18eab169691542ae7 | |
parent | f27919a0b1c36c568a0a7d4480e3a37e3f6e67af (diff) | |
download | opie-4b28f45cd1f6a72f41219786c7fb411523a6d622.zip opie-4b28f45cd1f6a72f41219786c7fb411523a6d622.tar.gz opie-4b28f45cd1f6a72f41219786c7fb411523a6d622.tar.bz2 |
Should fix bug 0000448
-rw-r--r-- | noncore/graphics/drawpad/filltool.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/filltool.cpp b/noncore/graphics/drawpad/filltool.cpp index 2a39d04..b47aa60 100644 --- a/noncore/graphics/drawpad/filltool.cpp +++ b/noncore/graphics/drawpad/filltool.cpp @@ -15,48 +15,53 @@ #include "drawpad.h" #include "drawpadcanvas.h" #include "page.h" #include <qimage.h> const int FILL_THRESHOLD = 65536; FillTool::FillTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) : Tool(drawPad, drawPadCanvas) { } FillTool::~FillTool() { } void FillTool::mousePressEvent(QMouseEvent* e) { int x = e->x(); int y = e->y(); m_image = m_pDrawPadCanvas->currentPage()->pixmap()->convertToImage(); + + if (m_image.depth() <= 8) { + m_image = m_image.convertDepth(32); + } + m_fillRgb = m_pDrawPad->brush().color().rgb(); m_oldRgb = m_image.pixel(x, y); if (m_oldRgb != m_fillRgb) { m_pDrawPadCanvas->backupPage(); if (m_pDrawPad->antiAliasing()) { m_mask.create(m_image.width(), m_image.height(), 8, 2); m_mask.fill(0); fillMaskLine(x, y); for (int i = 0; i < m_image.width(); i++) { for (int j = 0; j < m_image.height(); j++) { if (m_mask.pixelIndex(i, j) == 1) { setInterpolatedPixel(i, j); } } } } else { fillLine(x, y); } |