Make pictures use Streaming

This commit is contained in:
2022-07-03 23:55:21 +01:00
parent f9a904d52b
commit 7fa391eb6c
8 changed files with 54 additions and 46 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import Picture
import Geometry
--import Control.Monad
import Data.Maybe
import Data.Foldable
-- given a list of pictures that are each the size of a "text" call, displays them as
-- a list on the screen
@@ -30,7 +31,7 @@ listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize = win
hgt = 20 * fromIntegral cursysize
-- note we cannot simply scale lines because they are drawn as solid rectangles
chooseCursorBorders :: Float -> Float -> [Bool] -> Picture
chooseCursorBorders wth hgt = concat . catMaybes . zipWith f
chooseCursorBorders wth hgt = fold . catMaybes . zipWith f
[ line [V2 0 hgt , V2 wth hgt ]
, line [V2 wth hgt , V2 wth 0 ]
, line [V2 wth 0 , V2 0 0 ]