Commit Graph

9 Commits

Author SHA1 Message Date
Andrew Murray
90a52d3c0d Added width argument to polygon 2021-11-16 22:02:54 +11:00
Tsung-Po Sun
824d2fa4f3 Add test 2021-04-11 12:41:32 +10:00
Terseus
b987d90568 Added tests for lines with 1px slope
This tests are designed to guarantee that the wide lines behave exactly
like normal lines drawn with the Bresenham's algorithm.
This tests are somewhat subjective since this is non-defined behavior,
but I think that mimic the Bresenham's algorithm is reliable enough.

Currently the horizontal version of this test **fail**.
2014-04-09 19:34:50 +02:00
Terseus
4b7236f460 Added tests of hor/ver lines 101px wide
These tests should guarantee that the proportion of the width is
maintained with a margin of error < 1%.
2014-04-09 19:34:50 +02:00
Terseus
8228caf14d Added some oblique 45º lines tests
Only the oblique 3 pixels wide lines are defined:
* The oblique 2 pixels wide lines are somewhat hard to define.
* To define the oblique lines wider than 3 pixels we neet to define
  first how the oblique lines should expand their width (realistic or
  exact).
2014-04-09 19:33:46 +02:00
Terseus
1c02d467ef Added test for vertical lines.
The behavior is consistent with horizontal lines, see previous commit
for details.
2014-04-04 12:45:47 +02:00
Terseus
fee2faa8dc 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.
2014-04-04 12:35:26 +02:00
Terseus
e2cb2195eb Added test for a simple right triangle
The diagonals of the right angled edges must be perfect and the bottom
vertice should be drawn.
2014-04-04 11:46:58 +02:00
Terseus
ec74779b19 Added test for a simple square 2014-04-04 11:28:41 +02:00