From fee2faa8dc7e5c552bd389e399956b7abf9bde4f Mon Sep 17 00:00:00 2001 From: Terseus Date: Fri, 4 Apr 2014 12:35:26 +0200 Subject: [PATCH] Added test for horizontal lines Notice that the expansion of the line width depends on the order of the points: * If the bigger axis value is provided as the *second* point the line expand first to the *positive* side of the axis. * If the bigger axis value is provided as the *first* point the line expand first to the *negative* side of the axis. * If the line's width is odd this doesn't matter, as the line will expand the same amount to both sides. This behavior should be consistent in both horizontal and vertical lines. --- .../line_horizontal_w2px_inverted.png | Bin 0 -> 143 bytes .../imagedraw/line_horizontal_w2px_normal.png | Bin 0 -> 141 bytes .../images/imagedraw/line_horizontal_w3px.png | Bin 0 -> 145 bytes Tests/test_imagedraw.py | 25 ++++++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 Tests/images/imagedraw/line_horizontal_w2px_inverted.png create mode 100644 Tests/images/imagedraw/line_horizontal_w2px_normal.png create mode 100644 Tests/images/imagedraw/line_horizontal_w3px.png diff --git a/Tests/images/imagedraw/line_horizontal_w2px_inverted.png b/Tests/images/imagedraw/line_horizontal_w2px_inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..a2bb3bbabe8681bda838121298492ec0fa0ec7d4 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy&H|6fVg?3oVGw3ym^DWND9B#o z>FdgVkA;Pclf$Pc;3!Z?&(p;*#Nu@FjqUmO|NsAgQd#oEwVnC*?b;lZjhW*d4y65= l#lCjFd#>Ep${ja&7^0@%XP8{HC?2Sj!PC{xWt~$(697S^DlGs2 literal 0 HcmV?d00001 diff --git a/Tests/images/imagedraw/line_horizontal_w2px_normal.png b/Tests/images/imagedraw/line_horizontal_w2px_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d409ea48aa491f96ca5e7df6b95d10bb08a255 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy&H|6fVg?3oVGw3ym^DWND9B#o z>FdgVkA;Pc!;ovz%O0SRj;D)bh{fsT8{6~m|NsC0q_X6RYdiDr+qFGRG-i%-IFR;d jmb-KHm1lvoIVUrmh`i6R!7BRFdgVkA;O(nKNvekP=YHz|+Ms#Nu@FjqUmO|NsAgQd#oEwVnC*?b;lZjhW*d4y65= nm6`cjfcI_SZ1>z{>&`OdUpw;lGq3h@pk4+~S3j3^P6