diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-24 15:29:03 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-24 14:05:09 +0000 |
commit | 6067b74bb7baadbd28bfdfa8e2d63b775c972b0f (patch) | |
tree | 3918001366e4e6a2835153a7fb94cbd55cb5def5 /tests/auto/quick/qquickcanvasitem | |
parent | 27bee8076f50a948ffb9997e2a0673854681437d (diff) |
Fix hue clamping in Context2D
It goes from 0..359, not 0..255.
Task-number: QTBUG-47894
Change-Id: I0612a9d5e4999afae7703b5c49741b94fb0da07f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickcanvasitem')
-rw-r--r-- | tests/auto/quick/qquickcanvasitem/data/tst_context.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml index f266c16d76..566ad9d3d5 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml @@ -182,4 +182,22 @@ Canvas { } } } + + TestCase { + name: "Colors" + when: canvas.available + + function test_colors() { + wait(100); + compare(contextSpy.count, 1); + + var ctx = canvas.getContext("2d"); + // QTBUG-47894 + ctx.strokeStyle = 'hsl(255, 100%, 50%)'; + var c1 = ctx.strokeStyle.toString(); + ctx.strokeStyle = 'hsl(320, 100%, 50%)'; + var c2 = ctx.strokeStyle.toString(); + verify(c1 !== c2); + } + } } |