From ca9190c9d1ba2be6cac4d1da2cff4a17d3c1f11f Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Sun, 2 May 2004 11:10:22 +0000 Subject: [PATCH] Add the ability to set the background colour of an image to LColor::graphicsbg. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8719 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 8 ++++++++ src/frontends/qt2/QLImage.C | 13 +------------ src/frontends/qt2/QLPainter.C | 6 +++++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 94179c02d0..0e4f4f840c 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,11 @@ +2004-05-02 Angus Leeming + + * 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 * QGraphics.C: #include (STLport compile fix for floor()) diff --git a/src/frontends/qt2/QLImage.C b/src/frontends/qt2/QLImage.C index 302780d458..132f1f494c 100644 --- a/src/frontends/qt2/QLImage.C +++ b/src/frontends/qt2/QLImage.C @@ -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; } diff --git a/src/frontends/qt2/QLPainter.C b/src/frontends/qt2/QLPainter.C index 7ff297900c..f72ab542b5 100644 --- a/src/frontends/qt2/QLPainter.C +++ b/src/frontends/qt2/QLPainter.C @@ -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(i).qpixmap(), 0, 0, w, h); + lyx::graphics::QLImage const & qlimage = + static_cast(i); + + fillRectangle(x, y, w, h, LColor::graphicsbg); + qp_->drawPixmap(x, y, qlimage.qpixmap(), 0, 0, w, h); } -- 2.39.2