@@ -167,7 +167,7 @@ build_spans pic out_region = do
167167 let full_build = do
168168 start_image_build $ pic_image pic
169169 -- Fill in any unspecified columns with the background pattern.
170− forM_ [0 .. (region_height out_region - 1)] add_row_completion
170+ forM_ [0 .. (region_height out_region - 1)] (add_row_completion out_region)
171171 init_env = BlitEnv (pic_background pic) out_region out_ops
172172 init_state = BlitState 0 0 0 0 (region_width out_region) (region_height out_region)
173173 _ <- runStateT (runReaderT full_build init_env) init_state
@@ -211,7 +211,7 @@ add_unclipped (BGFill ow oh) = do
211211 Background c a <- view bg
212212 y <- use row_offset
213213 let op = TextSpan ow ow (T.encodeUtf8 $ T.replicate (fromIntegral ow) (T.singleton c))
214− forM_ [y..y+oh] $ \row -> do
214+ forM_ [y..y+oh-1] $ \row -> do
215215 snoc_op (AttributeChange a) row
216216 snoc_op op row
217217-- TODO: we know it's clipped actually, the equations that are exposed that introduce a
@@ -253,7 +253,7 @@ add_maybe_clipped (VertJoin top_image bottom_image _ow oh) = do
253253 oh
254254add_maybe_clipped (HorizJoin left_image right_image ow _oh) = do
255255 add_maybe_clipped_join "horiz_join" skip_columns remaining_columns column_offset
256− (image_width right_image)
256+ (image_width left_image)
257257 left_image
258258 right_image
259259 ow
@@ -336,11 +336,10 @@ add_unclipped_text txt = do
336336
337337-- todo: If there is no background pattern defined then skip to next line.
338338-- todo: assumes background character is 1 column
339−add_row_completion :: Int -> BlitM s ()
340−add_row_completion row = do
339+add_row_completion :: DisplayRegion -> Int -> BlitM s ()
340+add_row_completion display_region row = do
341341 all_row_ops <- view mrow_ops
342342 Background c a <- view bg
343− display_region <- view region
344343 row_ops <- lift $ lift $ Vector.read all_row_ops row
345344 let end_x = span_ops_effected_columns row_ops
346345 when (end_x < region_width display_region) $ do