@@ -76,51 +76,51 @@ renderView TimelineState{timelineDrawingArea, timelineVAdj, timelinePrevView}
7676 win <- widgetGetDrawWindow timelineDrawingArea
7777 renderWithDrawable win $ do
7878
79- let renderToNewSurface = do
80- new_surface <- withTargetSurface $ \ surface ->
81- liftIO $ createSimilarSurface surface ContentColor w (height params)
82- renderWith new_surface $ do
83- clearWhite
84- renderTraces params hecs rect
85- return new_surface
86-
87- surface <-
88- case prev_view of
89- Nothing -> renderToNewSurface
90-
91- Just (old_params, surface)
92- | old_params == params
93- -> return surface
94-
95- | width old_params == width params &&
96- height old_params == height params
97- -> do
98- if old_params { hadjValue = hadjValue params } == params
99- -- only the hadjValue changed
100- && abs (hadjValue params - hadjValue old_params) <
101- fromIntegral (width params) * scaleValue params
102- -- and the views overlap...
103- then
104- scrollView surface old_params params hecs
105- else do
106- renderWith surface $ do
107- clearWhite; renderTraces params hecs rect
108- return surface
109-
110- | otherwise
111- -> do surfaceFinish surface
112- renderToNewSurface
113-
114- liftIO $ writeIORef timelinePrevView (Just (params, surface))
115-
116- region exposeRegion
117- clip
118- setSourceSurface surface 0 (- vadj_value)
119- -- ^ ^ this is where we adjust for the vertical scrollbar
120- setOperator OperatorSource
121- paint
122- renderBookmarks bookmarks params
123- drawSelection params selection
79+ let renderToNewSurface = do
80+ new_surface <- withTargetSurface $ \ surface ->
81+ liftIO $ createSimilarSurface surface ContentColor w (height params)
82+ renderWith new_surface $ do
83+ clearWhite
84+ renderTraces params hecs rect
85+ return new_surface
86+
87+ surface <-
88+ case prev_view of
89+ Nothing -> renderToNewSurface
90+
91+ Just (old_params, surface)
92+ | old_params == params
93+ -> return surface
94+
95+ | width old_params == width params &&
96+ height old_params == height params
97+ -> do
98+ if old_params { hadjValue = hadjValue params } == params
99+ -- only the hadjValue changed
100+ && abs (hadjValue params - hadjValue old_params) <
101+ fromIntegral (width params) * scaleValue params
102+ -- and the views overlap...
103+ then
104+ scrollView surface old_params params hecs
105+ else do
106+ renderWith surface $ do
107+ clearWhite; renderTraces params hecs rect
108+ return surface
109+
110+ | otherwise
111+ -> do surfaceFinish surface
112+ renderToNewSurface
113+
114+ liftIO $ writeIORef timelinePrevView (Just (params, surface))
115+
116+ region exposeRegion
117+ clip
118+ setSourceSurface surface 0 (- vadj_value)
119+ -- ^ ^ this is where we adjust for the vertical scrollbar
120+ setOperator OperatorSource
121+ paint
122+ renderBookmarks bookmarks params
123+ drawSelection params selection
124124
125125-------------------------------------------------------------------------------
126126
0 commit comments