-
Notifications
You must be signed in to change notification settings - Fork 14
Is Point In Path
Andy Gill edited this page Jun 20, 2014
·
3 revisions
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Graphics.Blank
main = blankCanvas 3000 $ \ context -> do
send context $ do
strokeStyle "blue";
beginPath();
rect(100,100,200,200)
cmds <- sequence [ do
b <- isPointInPath (x,y)
return $ do
beginPath()
fillStyle $ if b then "red" else "green"
arc(x, y, 5, 0, pi*2, False)
fill()
| x <- take 8 [25,25+50..]
, y <- take 8 [25,25+50..]
]
stroke()
-- Now draw the points
sequence_ cmds