From kde-kimageshop Wed Oct 08 21:04:14 2003 From: Boudewijn Rempt Date: Wed, 08 Oct 2003 21:04:14 +0000 To: kde-kimageshop Subject: Bwerk! X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=106564724131858 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============69679619322497188==" --===============69679619322497188== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_RvHh/2U3m+yztmZ"; charset="us-ascii" Content-Transfer-Encoding: 7bit --Boundary-02=_RvHh/2U3m+yztmZ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline I managed to mess things up good and well... I added the following to kis_painter, knowing full well I wasn't supposed t= o=20 mess about with QPixmaps, but still doing so for the sake of quick results: void KisPainter::drawPolyline(const QPointArray& polyline) { QRect r =3D polyline.boundingRect(); r =3D r.normalize(); KisTileMgrSP tileMgr =3D m_device -> data(); // Let's hope that PJ counts from left-top to right-bottom, too, KisPixelDataSP pixels =3D tileMgr->pixelData( r.left(), r.top(), r.right(), r.bottom(), TILEMODE_RW ); QImage image =3D QImage( ( int ) pixels->data, r.width(), r.height(), tileMgr->depth() ); QPixmap buffer =3D QPixmap( image ); QPainter p; p.begin(&buffer); p.drawPolyline( polyline ); p.end(); tileMgr->writePixelData( pixels ); // memcpy to destination tileMgr->releasePixelData( pixels ); // Is this necessary? m_device->invalidate( r ); // And this? } And then I called that like this: void KisToolBrush2::mouseMove(QMouseEvent *e) { if ( m_mousePressed ) { m_polyline[2] =3D m_polyline[1]; m_polyline[1] =3D m_polyline[0]; m_polyline[0] =3D e->pos(); QRect r =3D m_polyline.boundingRect(); r =3D r.normalize(); KisImageSP img =3D m_view -> currentImg(); if (img) { KisPaintDeviceSP device =3D img -> activeDevice(); if (device) { KisPainter p; p.begin(device); p.drawPolyline( m_polyline ); p.end(); //m_doc -> addCommand(new Brush2Cmd(img)); device->anchor(); } } img -> invalidate(r); m_view -> updateCanvas(r); } And now Krita crashes in drawPolyline, giving me the distinc impression I=20 should finish reading Accelerated C++ as soon as possible... Back to comfy= =20 chair and the meditative pipe for now. =2D-=20 Boudewijn Rempt | http://www.valdyas.org/index2.html --Boundary-02=_RvHh/2U3m+yztmZ Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD4DBQA/hHvRdaCcgCmN5d8RArKHAJd16e7KM7aRUEQzy4yxuTCDL+87AJ0S+B/G LwnCkGlz0vjWlHMnXN/8qg== =8UyQ -----END PGP SIGNATURE----- --Boundary-02=_RvHh/2U3m+yztmZ-- --===============69679619322497188== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kimageshop mailing list kimageshop@mail.kde.org http://mail.kde.org/mailman/listinfo/kimageshop --===============69679619322497188==--