module Hoodle.ModelAction.Eraser where
import Control.Monad.State
import Data.Hoodle.BBox
import Graphics.Hoodle.Render.Type.HitTest
import Graphics.Hoodle.Render.Util.HitTest
eraseHitted :: (GetBBoxable a) =>
AlterList (NotHitted a) (AlterList (NotHitted a) (Hitted a))
-> State (Maybe BBox) [a]
eraseHitted Empty = error "something wrong in eraseHitted"
eraseHitted (n :-Empty) = return (unNotHitted n)
eraseHitted (n:-h:-rest) = do
mid <- elimHitted h
return . (unNotHitted n ++) . (mid ++) =<< eraseHitted rest