added another test
This commit is contained in:
parent
1392b6caa8
commit
4c11aac929
1 changed files with 33 additions and 0 deletions
|
@ -289,3 +289,36 @@ func TestAlpha(t *testing.T) {
|
|||
cv.Stroke()
|
||||
})
|
||||
}
|
||||
|
||||
func TestClosePath(t *testing.T) {
|
||||
run(t, func(cv *canvas.Canvas) {
|
||||
cv.SetStrokeStyle("#0F0")
|
||||
cv.SetLineWidth(2.5)
|
||||
cv.BeginPath()
|
||||
cv.MoveTo(20, 20)
|
||||
cv.LineTo(40, 20)
|
||||
cv.LineTo(40, 40)
|
||||
cv.LineTo(20, 40)
|
||||
cv.ClosePath()
|
||||
cv.MoveTo(60, 20)
|
||||
cv.LineTo(80, 20)
|
||||
cv.LineTo(80, 40)
|
||||
cv.LineTo(60, 40)
|
||||
cv.ClosePath()
|
||||
cv.Stroke()
|
||||
|
||||
cv.SetFillStyle("#00F")
|
||||
cv.BeginPath()
|
||||
cv.MoveTo(20, 60)
|
||||
cv.LineTo(40, 60)
|
||||
cv.LineTo(40, 80)
|
||||
cv.LineTo(20, 80)
|
||||
cv.ClosePath()
|
||||
cv.MoveTo(60, 60)
|
||||
cv.LineTo(80, 60)
|
||||
cv.LineTo(80, 80)
|
||||
cv.LineTo(60, 80)
|
||||
cv.ClosePath()
|
||||
cv.Fill()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue