Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.3, 5.15.5
-
-
c31638f16b1fe709dd9df232afb9ab7fac3b231e (qt/qtdeclarative/dev) 9a967bf6a6583099d5593e95e29118139f8be975 (qt/qtdeclarative/6.1) 5fde06d4b7113408cb1edc9a2ca4d8aa5a9884af (qt/qtdeclarative/6.2) 1ec362aa10 (qt/tqtc-qtdeclarative/5.15-opensource)
Description
Reset line dash pattern not working in Canvas
import QtQuick 2.12 import QtQuick.Window 2.12 Window { width: 640 height: 480 visible: true Canvas { anchors.fill: parent onPaint: { var ctx = getContext("2d") ctx.lineWidth = 3 ctx.save() ctx.setLineDash([3, 5]) ctx.beginPath() ctx.moveTo(0, 0) ctx.lineTo(250, 250) ctx.stroke() ctx.restore() ctx.save() ctx.setLineDash([]) //no effect ctx.beginPath() ctx.moveTo(50, 0) ctx.lineTo(300, 250) ctx.stroke() ctx.restore() } } }