Hi all,
before i forget the details, i've done some tests about the 1 pixel bug in 
framesvg and what i found is this:
it happens only when the svgrenderer paints on a qpixmap, if asked to paint on 
all of it, sometimes the last pixel gets not painted, the minimum amount of 
code to reliably cause this is the file attached, note the 1 pixel red line 
that appears sometimes.

i've done a git bisect on the qt/all snapshot branch and probably doesn't tell 
that much (it does just reflet snapshots and not actual commits right?)
but what i've found, if i didn't did terrible mistakes is that:

(if it's not a really trivial thing to fix i'm going to post this on the qt 
task tracker)

355c90dad265a6c3b20f7bffeeabdc420ace78ee is first bad commit
commit 355c90dad265a6c3b20f7bffeeabdc420ace78ee
Author: Snapshots <snapsh...@trolltech.com>
Date:   Wed Dec 3 02:00:16 2008 +0100

    Update to Qt 4.5 snapshot 20081203

:100644 100644 f053d8e7342aa99764f9f4674296d9ca9a4db372 
8a9943da9b00c055f7d8dd5ebaffe0698c9502b4 M .tag
:040000 040000 24d96e05510c648058db5df5b5ef2bbad15f82c9 
7961db773e9b5b60ec300edbddcc87998d1c068b M doc
:040000 040000 60df8b9737bcb54961c379640241c725963dee04 
7d3f9d1080034f16a11fc1a7caf0d581a59ed4a9 M qmake
:040000 040000 f89dd3fb8c536d65c8a0f091807c0a61030b4f59 
ded3aa6cdf7bec61efad821e255565a07c39452b M src
:040000 040000 6edf3b7029b91891f30295e21e49f9a6c1380159 
20fa707790f7a3d935642e39ac7561832d9692c7 M tools
 
#include <QtGui>
#include <QtSvg>
#include <QSvgRenderer>

class SvgTest : public QGraphicsWidget
{
    public:
        SvgTest( QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0 )
            : QGraphicsWidget( parent, wFlags )
        {
            r = new QSvgRenderer(this);
            r->load(QString("background.svg"));
            resize( 50, 50 );
        }
        ~SvgTest() {};

        void paint( QPainter * painter, const QStyleOptionGraphicsItem * opt,
                    QWidget * )
        {
            QPixmap centerpix(size().toSize());
            centerpix.fill(Qt::red);
            QPainter centerP(&centerpix);
            r->render ( &centerP, "center",
                        QRectF(QPointF(0,0), centerpix.size()) );
            centerP.end();
            painter->drawPixmap(QPoint(0,0), centerpix);
        }
        QSvgRenderer *r;
};


int main( int argc, char * argv[])
{
    QApplication app( argc, argv );
    QGraphicsScene scene;
    QGraphicsWidget * svg = new SvgTest(0,Qt::Window);
svg->setWindowFrameMargins ( 10,10,10,10);
    scene.addItem( svg );
    QGraphicsView view( & scene );
    view.show();
    return app.exec();
}
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to