Permalink
Browse files

a bit of code cleanup -- use mkSizeSpec

  • Loading branch information...
1 parent 3e45807 commit 6fa33a0bf39c1a9afdeb67603630d453d1681bca Brent Yorgey committed Apr 25, 2012
Showing with 11 additions and 12 deletions.
  1. +11 −12 src/Diagrams/Backend/Cairo/CmdLine.hs
@@ -140,18 +140,17 @@ chooseRender opts d =
"pdf" -> PDF
"svg" -> SVG
_ -> PDF
- sizeSpec = case (width opts, height opts) of
- (Nothing, Nothing) -> Absolute
- (Just w, Nothing) -> Width (fromIntegral w)
- (Nothing, Just h) -> Height (fromIntegral h)
- (Just w, Just h) -> Dims (fromIntegral w)
- (fromIntegral h)
- fst $ renderDia Cairo (CairoOptions
- (output opts)
- sizeSpec
- outTy
- )
- d
+ fst $ renderDia
+ Cairo
+ ( CairoOptions
+ (output opts)
+ (mkSizeSpec
+ (fromIntegral <$> width opts)
+ (fromIntegral <$> height opts)
+ )
+ outTy
+ )
+ d
| otherwise -> putStrLn $ "Unknown file type: " ++ last ps
-- | @multiMain@ is like 'defaultMain', except instead of a single

0 comments on commit 6fa33a0

Please sign in to comment.