xdot 0.2 → 0.2.1
raw patch · 2 files changed
+21/−9 lines, 2 files
Files
- src/Graphics/XDot/Viewer.hs +19/−8
- xdot.cabal +2/−1
src/Graphics/XDot/Viewer.hs view
@@ -56,22 +56,36 @@ stylizedDraw :: Eq t => Bool -> Object t -> Object t -> Render a -> DrawState () stylizedDraw filled mn hover renderOps = do- (r,g,b,a) <- getCorrectColor filled+ (rf,gf,bf,af) <- gets filledColor+ (rs,gs,bs,as) <- gets strokeColor lWidth <- gets lineWidth lStyle <- gets lineStyle lift $ do- if mn /= None && mn == hover- then if filled then setSourceRGBA 1 0 0 0.3 else setSourceRGBA 1 0 0 1- else setSourceRGBA r g b a+ when filled $ do+ if mn /= None && mn == hover+ then setSourceRGBA 1 0.8 0.8 1+ else setSourceRGBA rf gf bf af++ save+ renderOps+ restore++ fillPreserve+ fill+ setLineWidth lWidth setDash lStyle 0 + if mn /= None && mn == hover+ then setSourceRGBA 1 0 0 1+ else setSourceRGBA rs gs bs as+ save renderOps restore - if filled then fillPreserve >> fill else stroke+ stroke draw :: Eq t => Object t -> (Object t, Operation) -> DrawState [(Object t, Rectangle)] draw hover (mn, Ellipse (x,y) w h filled) = do@@ -196,6 +210,3 @@ return [] draw _ (_, Image{}) = return [] -- TODO--getCorrectColor :: Bool -> DrawState RGBA-getCorrectColor filled = gets $ if filled then filledColor else strokeColor
xdot.cabal view
@@ -1,5 +1,5 @@ name: xdot-version: 0.2+version: 0.2.1 license: BSD3 license-file: LICENSE category: Graphs, Graphics@@ -18,6 +18,7 @@ For an example of using this library try the accompanying @Demo.hs@ with the dot-files in @dot-examples/@. +tested-with: GHC == 7.4.1, GHC == 7.4.2 Extra-source-files: Demo.hs, dot-examples/*.dot Library Exposed-modules: Graphics.XDot.Parser Graphics.XDot.Viewer Graphics.XDot.Types