packages feed

puzzle-draw-cmdline 0.1.0.3 → 0.1.0.4

raw patch · 3 files changed

+11/−8 lines, 3 filesdep ~puzzle-draw

Dependency ranges changed: puzzle-draw

Files

CHANGES.md view
@@ -1,3 +1,8 @@+0.1.0.4: 20140419+-----------------++* adapt to new puzzle-draw release+ 0.1.0.3: 20140416 ----------------- 
puzzle-draw-cmdline.cabal view
@@ -1,5 +1,5 @@ name:                puzzle-draw-cmdline-version:             0.1.0.3+version:             0.1.0.4 synopsis:            Creating graphics for pencil puzzles, command line tools. description:         Companion executable to puzzle-draw. Separate to keep                      the dependency on diagrams-cairo out of the library.@@ -23,7 +23,7 @@   main-is:          drawpuzzle.hs   hs-source-dirs:   src/tools   build-depends:       base >= 4.2 && < 4.8,-                       puzzle-draw >= 0.1.0 && < 0.1.1,+                       puzzle-draw >= 0.1.0.2 && < 0.1.1,                        diagrams-lib >= 1.0 && < 1.2,                        yaml >= 0.8 && < 0.9,                        optparse-applicative >= 0.7 && < 0.9,
src/tools/drawpuzzle.hs view
@@ -3,7 +3,6 @@ module Main where  import Diagrams.Prelude hiding (value, option, (<>), Result)-import Diagrams.BoundingBox  #ifdef CAIRO import Diagrams.Backend.Cairo (B, renderCairo)@@ -76,11 +75,11 @@ toRenderOpts oc w opts = RenderOpts out w'   where     f = _format opts-    w' = case f of "png" -> round' (40 * w)-                   _     -> cmtopoint (0.8 * w)+    u = case f of "png" -> Pixels+                  _     -> Points+    w' = toOutputWidth u w     base = takeBaseName (_input opts)     out = addExtension (base ++ outputSuffix oc) f-    round' = (fromIntegral :: Int -> Double) . round  renderB :: FilePath -> SizeSpec2D -> Diagram B R2 -> IO () renderB =@@ -102,8 +101,7 @@         else return ()     when (isJust x) $ do         let Just x' = x-            w = fst . unr2 . boxExtents . boundingBox $ x'-            ropts = toRenderOpts oc w opts+            ropts = toRenderOpts oc (diagramWidth x') opts         renderToFile ropts x'  defaultOpts :: Parser a -> IO a