eventloop 0.8.0.0 → 0.8.0.1
raw patch · 3 files changed
+9/−7 lines, 3 files
Files
- eventloop.cabal +1/−1
- src/Eventloop/Module/DrawTrees/DrawTrees.hs +3/−3
- src/Eventloop/Utility/Trees/GeneralTree.hs +5/−3
eventloop.cabal view
@@ -6,7 +6,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change -version: 0.8.0.0 +version: 0.8.0.1 synopsis: A different take on an IO system. Based on Amanda's IO loop, this eventloop takes a function that maps input events to output events. It can easily be extended by modules that represent IO devices or join multiple modules together. description: A different take on an IO system. Based on Amanda's IO loop, this eventloop takes a function that maps input events to output events. It can easily be extended by modules that represent IO devices or join multiple modules together. Each module exists of a initialize and teardown function that are both called once at startup and shutting down. During run-time, a module can provice a preprocessor function (which transforms input events before they get to the eventloop),
src/Eventloop/Module/DrawTrees/DrawTrees.hs view
@@ -62,11 +62,11 @@ showGeneralTree :: LeftOffset -> TopOffset -> Int -> GeneralTree -> (Shape, RightOffset, BottomOffset) -showGeneralTree left top i tree = (CompositeShape [treeIndexShape, treeShape] Nothing Nothing, right, bottom) +showGeneralTree left top i tree = (CompositeShape [treeIndexShape, treeShape] Nothing Nothing, right, bottom) where - (ltree, right, bottom) = layoutGeneralTree left top tree + (ltree, right, bottom) = layoutGeneralTree left' top tree treeShape = printTree ltree - treeIndexShape = treeIndex i (left, top) + (treeIndexShape, left') = treeIndex i (left, top) instance GeneralizeTree RBTree where generalizeTree (RBNode col _ []) = GeneralTreeBox content []
src/Eventloop/Utility/Trees/GeneralTree.hs view
@@ -130,9 +130,11 @@ textWidth = charWidth * (fromIntegral (length str)) -treeIndex :: Int -> Offset -> Shape -treeIndex i (x, y) = Text iStr "Courier" 20 p AlignLeft (255,75,75, 255) 1 (0,0,0,0) Nothing +treeIndex :: Int -> Offset -> (Shape, LeftOffset) +treeIndex i (x, y) = (text, x + wText) where iStr = show i (wText, hText) = textSize iStr - p = Point (x + 0.5 * wText, y) + p = Point (x, y) + text = Text iStr "Courier" 20 p AlignLeft (255,75,75, 255) 1 (0,0,0,0) Nothing +