]> git.lyx.org Git - features.git/commitdiff
Add the ability to set the background colour of an image to
authorAngus Leeming <leeming@lyx.org>
Sun, 2 May 2004 11:10:22 +0000 (11:10 +0000)
committerAngus Leeming <leeming@lyx.org>
Sun, 2 May 2004 11:10:22 +0000 (11:10 +0000)
LColor::graphicsbg.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8719 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QLImage.C
src/frontends/qt2/QLPainter.C

index 94179c02d0817f38443abdcff769bf0c106b99cb..0e4f4f840c9531b8664b0f46f565f0a3478e452b 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * QLPainter.C (image): set the background colour to
+       LColor::graphicsbg.
+
+       * QLImage.C (setPixmap_impl): remove commented out xforms code
+       to set pixmap background colour.
+
 2004-05-02  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * QGraphics.C: #include <cmath> (STLport compile fix for floor())
index 302780d458e2b8ce83d0aac9b3bf9bba8492c644..132f1f494cd0ddbd38fb591b0557f11011ebaae1 100644 (file)
@@ -158,7 +158,7 @@ QImage & toGray(QImage & img)
 {
        if (img.width() == 0 || img.height() == 0)
                return img;
+
        int const pixels = img.depth() > 8 ?
                img.width() * img.height() : img.numColors();
 
@@ -197,17 +197,6 @@ bool QLImage::setPixmap_impl(Params const & params)
                default:
                        break;
        }
-// FIXME
-#if 0
-       unsigned int fill = packedcolor(LColor::graphicsbg);
-       if (fill != image_->fill_color) {
-               // the background color has changed.
-               // Note that in grayscale/monochrome images the background is
-               // grayed also, so this call will have no visible effect. Sorry!
-               flimage_replace_pixel(image_, image_->fill_color, fill);
-               image_->fill_color = fill;
-       }
-#endif
 
        return true;
 }
index 7ff297900ccaaf812f5b6f50361e9cd806d20a7e..f72ab542b50f4714c4fb427cffe038196775ae91 100644 (file)
@@ -166,7 +166,11 @@ void QLPainter::arc(int x, int y, unsigned int w, unsigned int h,
 void QLPainter::image(int x, int y, int w, int h,
        lyx::graphics::Image const & i)
 {
-       qp_->drawPixmap(x, y, static_cast<lyx::graphics::QLImage const &>(i).qpixmap(), 0, 0, w, h);
+       lyx::graphics::QLImage const & qlimage =
+               static_cast<lyx::graphics::QLImage const &>(i);
+
+       fillRectangle(x, y, w, h, LColor::graphicsbg);
+       qp_->drawPixmap(x, y, qlimage.qpixmap(), 0, 0, w, h);
 }