From 73188e8d1c6333f7500f856ffd7aa12a66fccc9b Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 17 Jan 2012 15:05:52 +0000 Subject: Renderer: fix confused thinking about edgemost apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Bustle/Renderer.hs | 15 ++++----------- 1 file 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] -- cgit v1.2.3