summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-01-17 15:50:37 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-02-05 22:47:16 +0000
commit66c3a71e91edefdf5bc5c8efb009fb5f0f330cd1 (patch)
tree7e5ce8966d8b2f1953cc6c7ce88c34184e6985cb /tests
parente96641d881f2106151995c812fabb9d6c58beccb (diff)
Painter path stroking: fix capping of beziers ending in tight turns
For some overly tight beziers where the start or end point and the next control point are closer than the pen width, the stroker's shifting algorithm will produce a start/end tangent pointing in the opposite direction from what is expected, for one of the sides. This would break the square and round capping logic. Fix by detecting the situation in the capping function and reversing the tangent when necessary. Change-Id: I48f4f017403d7b289b0483dd2b3a7ff1bbd0cf2a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/lancelot/scripts/degeneratebeziers.qps28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
index fb223d5b1f..6c069fd82f 100644
--- a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
+++ b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
@@ -7,4 +7,30 @@ path_cubicTo degenerate 3427.0918499999997948 3872.1318999999994048 4729.4590867
scale 0.05 0.05
translate -2500 -3000
setPen black 800
-drawPath degenerate \ No newline at end of file
+drawPath degenerate
+
+resetMatrix
+path_moveTo revbez 0 20
+path_cubicTo revbez 0 0 120 0 120 -20
+
+path_moveTo revbez 0 80
+path_cubicTo revbez 0 100 120 100 120 120
+
+translate 50 250
+
+setPen blue 40 solidline flatcap
+drawPath revbez
+setPen red 0
+drawPath revbez
+
+translate 200 0
+setPen blue 40 solidline squarecap
+drawPath revbez
+setPen red 0
+drawPath revbez
+
+translate 200 0
+setPen blue 40 solidline roundcap
+drawPath revbez
+setPen red 0
+drawPath revbez