Skip to content

tests: add CGContext line attribute tests - #42

Open
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:tests/cgcontext-line
Open

tests: add CGContext line attribute tests#42
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:tests/cgcontext-line

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

Adds render tests for the CGContext stroke line attributes: line width, line cap, and line dash. A path is stroked in green on a transparent device-RGB bitmap and the alpha of sample pixels is checked (a pixel is "painted" when its alpha is non-zero).

  • Line width - a thin (1pt) line paints along its path but does not reach a pixel three rows away, while a wide (6pt) line does.
  • Line cap - a butt cap does not extend past the segment's endpoint, whereas a square cap does.
  • Line dash - a [2,2] dash pattern paints its on segments and leaves gaps between them.

Which pixels are painted matches Apple CoreGraphics; the exact antialiased coverage values are not compared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant