@@ -129,43 +129,25 @@ intMkVty input out = do
129129 lastUpdateRef <- newIORef Nothing
130130
131131 let innerUpdate inPic = do
132− b@(w,h) <- displayBounds out
132+ b <- displayBounds out
133133 let cursor = picCursor inPic
134− inPic' = case cursor of
135− AbsoluteCursor x y ->
136− let x' = max 0 (min (w-1) x)
137− y' = max 0 (min (h-1) y)
138− in inPic { picCursor = AbsoluteCursor x' y' }
139− -- TODO: account for logical width in Cursor case
140− Cursor x y ->
141− let
142− x' = case x of
143− _ | x < 0 -> 0
144− | x >= w -> w - 1
145− | otherwise -> x
146− y' = case y of
147− _ | y < 0 -> 0
148− | y >= h -> h - 1
149− | otherwise -> y
150− in inPic { picCursor = Cursor x' y' }
151− _ -> inPic
152134 mlastUpdate <- readIORef lastUpdateRef
153135 updateData <- case mlastUpdate of
154136 Nothing -> do
155137 dc <- displayContext out b
156− outputPicture dc inPic'
138+ outputPicture dc inPic
157139 return (b, dc)
158140 Just (lastBounds, lastContext) -> do
159141 if b /= lastBounds
160142 then do
161143 dc <- displayContext out b
162− outputPicture dc inPic'
144+ outputPicture dc inPic
163145 return (b, dc)
164146 else do
165− outputPicture lastContext inPic'
147+ outputPicture lastContext inPic
166148 return (b, lastContext)
167149 writeIORef lastUpdateRef $ Just updateData
168− writeIORef lastPicRef $ Just inPic'
150+ writeIORef lastPicRef $ Just inPic
169151
170152 let innerRefresh = do
171153 writeIORef lastUpdateRef Nothing