Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.4
-
None
Description
It looks like the internal openGL paint engine is not initialized correctly when openGL widget and/or is recreated in a single session of the application run.
Here in Krita we have a code for painting transformation handles above the image. Simplified version:
gc.setTransform(m_d->handlesTransform);
gc.setBrush(Qt::gray);
gc.setPen(QPen(Qt::red, 0));
gc.drawRect(m_d->transaction.originalRect());
Where the transformation is of a TxProject type:
m_d->handlesTransform = QTransform(type=TxProject, 11=0.599735 12=-0.273617 13=-0.000434839 21=0.966287 22=1.98867 23=0.000371011 31=49.5932 32=-974.077 33=1.29809)
m_d->transaction.originalRect() = QRectF(1449,909 124x117)
When I open application, the handles are painted correctly:
http://pasteboard.co/1GOr4NoU.png
Then I close the document and reopen it. In the meantime Krita recreates QGLWidget object and reinitializes QGLContext. After this trick the handles are painted incorrectly: the stroke is separated from the internal filling, though they are done using a single line of code:
http://pasteboard.co/1GOudKyy.png
Observations:
1) The first opened document (therefore the first created QGLWidget) always works fine. Second and all the rest fail to paint a stroke.
2) The offset of the red stroke is always random.
3) Only openGL paint engine is affected (the one used for QImage works fine).
4) Only cosmetic strokes are affected. Changing pen size to '1' fixes the problem. Therefore I have a feeling that the code in QGL2PaintEngineEx::stroke() is the cause of it. It has a special branch for such brushes.
That is the best I could find out about the bug. I can test any patches and do some more investigations if needed.