Version: 1.2.1 (using KDE KDE 3.5.0) Installed from: Compiled From Sources OS: Linux PROBLEM: An image object with a transparent area will not always paint correctly STEPS TO REPRODUCE: Start Kst Create a plot with a curve Add an image object with a transparent region (e.g. kst_advance.png) Size the image such that individual pixels are clearly visible Switch to layout mode Double click on the image Move the Edit Picture dialog so that it lies over some of the transparent trgion of the image Hit OK RESULTS: The transparent region of the image still shows the dialog EXPECTED RESULTS: The transparent region of the image should show the underlying plot
The problem is that the clipRegion() for the image is being incorrectly returned, because _clipMask is being incorrectly calculated. In turn _clipMask is incorrectly calculated as KstViewPicture::transparent() is returning false and so the KstViewObject::paintSelf() code is filling in the entire geometry of the image. This results in a clipRegion() which is the entire area of the image, instead of only its non-transparent area. And finally, this occurs because _iCache is not valid immediately after hitting the Ok button in the edit dialog, so _iCache.hasAlphaBuffer() will return false in such conditions.
SVN commit 558770 by arwalker: BUG:129595 Correctly handle transparency of images with alpha buffers M +5 -1 kstviewpicture.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstviewpicture.cpp #558769:558770 @@ -272,7 +272,11 @@ bool KstViewPicture::transparent() const { - return _iCache.hasAlphaBuffer(); + if (!_iCache.isNull()) { + return _iCache.hasAlphaBuffer(); + } + + return _image.hasAlphaBuffer(); }