diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-15 01:00:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-15 10:41:32 +0100 |
commit | 1ffb45a3682c864f8071b8b19da49c9a7761dd5e (patch) | |
tree | b714f329d1e2a1ecccc0d5c13fb829f924f0d801 /src/quick/items | |
parent | 3dcc9dde65c780fb87ff9feef60dfb16d6748eb0 (diff) | |
parent | d96a700cc3611480ff76023287cb06f455a37b02 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/qml/qml/qqmlpropertycache.cpp
Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index de19a927a0..546f3011ec 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -1548,7 +1548,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(const QV4::Function if (value->as<Object>()) { QColor color = scope.engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>(); if (color.isValid()) { - r->d()->context()->state.fillStyle = color; + r->d()->context()->state.strokeStyle = color; r->d()->context()->buffer()->setStrokeStyle(color); r->d()->context()->m_strokeStyle.set(scope.engine, value); } else { @@ -1559,7 +1559,12 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(const QV4::Function r->d()->context()->m_strokeStyle.set(scope.engine, value); r->d()->context()->state.strokePatternRepeatX = style->d()->patternRepeatX; r->d()->context()->state.strokePatternRepeatY = style->d()->patternRepeatY; - + } else if (!style && r->d()->context()->state.strokeStyle != QBrush(QColor())) { + // If there is no style object, then ensure that the strokeStyle is at least + // QColor in case it was previously set + r->d()->context()->state.strokeStyle = QBrush(QColor()); + r->d()->context()->buffer()->setStrokeStyle(r->d()->context()->state.strokeStyle); + r->d()->context()->m_strokeStyle.set(scope.engine, value); } } } else if (value->isString()) { |