Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.15.2
-
None
Description
Run this in qmlscene. If bug is true, it will render a window that is 50% white, and 50% green. If bug is false, the window is 100% green. If you do not set the render target, the bug is gone. Setting a canvasSize has no effect on the bug.
This seems to be quite a nasty rounding error.
The only workaround we have found is to not render so small things.
Unable to find source-code formatter for language: qml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
import QtQuick 2.14 Item { id: root width: 100 property bool bug: true height: bug ? 30 : 75 Canvas { renderTarget: Canvas.FramebufferObject // comment out to remove bug anchors.fill: parent onPaint: { var ctx = getContext('2d') ctx.lineCap = "square" ctx.clearRect(0, 0, width, height) ctx.fillStyle = Qt.rgba(0, 1, 0, 1.0); ctx.fillRect(0, 0, width, height); } } }
Attachments
Issue Links
- relates to
-
QTBUG-96589 Canvas's size is incorrect when renderTarget is set to FramebufferObject
- Closed