diff options
author | Will Thompson <will@willthompson.co.uk> | 2012-01-17 15:05:52 +0000 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2012-01-17 15:10:13 +0000 |
commit | 73188e8d1c6333f7500f856ffd7aa12a66fccc9b (patch) | |
tree | 86622deeb7dda651532599b005df0052c907cc19 | |
parent | 5526f11b1971a502dd787c280560a31207d8b902 (diff) |
Renderer: fix confused thinking about edgemost apps
Previously, 'edgemostApp' threw in the coordinates for the next column as
well as for all the active columns, citing a poorly-specified rendering
glitch on the system bus logs. This turned out to specifically be that
one end of all signal lines was wildly misplaced. This in turn was due
to the per-bus sign stuff in 'signal' being upside-down: that function
was adding/removing one column width to compensate for the extra column
width added by edgemostApp (!), but in the wrong direction… so if we
just knocked both out we're grand.
In turn, the signs in getLeftMargin and getRightMargin (which add a
little padding so that the horizontal rules extend to roughly half a
column width past the outermost vertical line) were upside-down to
compensate for the extra column width being added.
-rw-r--r-- | Bustle/Renderer.hs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Bustle/Renderer.hs b/Bustle/Renderer.hs index 608aff3..3b4a576 100644 --- a/Bustle/Renderer.hs +++ b/Bustle/Renderer.hs @@ -518,9 +518,9 @@ findCallCoordinates bus = maybe (return Nothing) $ \m -> do -- without overlapping the rule. getLeftMargin, getRightMargin :: Renderer Double getLeftMargin = - maybe 0 (+ 35) <$> edgemostApp SystemBus + maybe 0 (subtract 35) <$> edgemostApp SystemBus getRightMargin = - maybe timestampAndMemberWidth (subtract 35) <$> edgemostApp SessionBus + maybe timestampAndMemberWidth (+ 35) <$> edgemostApp SessionBus advanceBy :: Double -> Renderer () advanceBy d = do @@ -573,10 +573,7 @@ edgemostApp bus = do if first == next then return Nothing - -- FIXME: Including 'next' here seems to fix the rendering of signals - -- which are the first appearence on the chart of a name on the system - -- bus. This is a hack but I CBA to figure out why. - else return $ Just $ edgiest (next:xs) + else return $ Just $ edgiest xs senderCoordinate :: Bus -> DetailedMessage @@ -736,13 +733,9 @@ signal bus dm = do Just target -> do shape $ DirectedSignalArrow emitter target t Nothing -> do - -- FIXME: per-bus sign. - let f = case bus of - SessionBus -> subtract - SystemBus -> (+) -- fromJust is safe here because we must have an app to have a -- signal. It doesn't make me very happy though. - outside <- f columnWidth . fromJust <$> edgemostApp bus + outside <- fromJust <$> edgemostApp bus inside <- getsBusState firstColumn bus let [x1, x2] = sort [outside, inside] |