Skip to content

Commit

Permalink
fix: Default to black fill color for shapes in animations
Browse files Browse the repository at this point in the history
Previously, they were transparent unless an explicit color was set, which could be confusing, particularly since we opted not to show outlines.

Signed-off-by: George Thomas <[email protected]>
  • Loading branch information
georgefst committed Nov 22, 2023
1 parent fe81466 commit 97bb08b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion primer/src/Primer/Primitives.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ import Diagrams.Backend.Rasterific (
import Diagrams.Prelude (
Diagram,
V2 (..),
black,
circle,
deg,
fillColor,
lineWidth,
mkP2,
mkSizeSpec,
recommendFillColor,
rect,
rectEnvelope,
renderDia,
Expand Down Expand Up @@ -402,7 +404,7 @@ primFunDef def args = case def of
Con _ c [x] | c == cSucc -> succ <$> exprToNat x
_ -> Nothing
exprToDiagram e =
exprToPicture e <&> fix \f -> \case
exprToPicture e <&> recommendFillColor black . fix \f -> \case
Circle r ->
if r == 0 -- `diagrams` crashes with a divide-by-zero if we don't catch this case
then mempty
Expand Down

0 comments on commit 97bb08b

Please sign in to comment.