mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 12:56:08 +00:00
Move ManuallySized
to a separate module.
Purpose: allow it to be used both for static and animated diagrams.
This commit is contained in:
parent
76945388e8
commit
ad89fc4554
@ -1,5 +1,4 @@
|
||||
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
|
||||
{-# LANGUAGE DeriveFunctor, DeriveGeneric #-}
|
||||
|
||||
module IHaskell.Display.Diagrams
|
||||
( diagram, animation
|
||||
@ -12,14 +11,7 @@ import Diagrams.Backend.Cairo
|
||||
import Diagrams.Prelude
|
||||
import IHaskell.Display
|
||||
import IHaskell.Display.Diagrams.Animation
|
||||
|
||||
import GHC.Generics (Generic)
|
||||
|
||||
data ManuallySized a = ManuallySized
|
||||
{ contentToDisplay :: a
|
||||
, imgManualWidth :: Double
|
||||
, imgManualHeight :: Double
|
||||
} deriving (Show, Functor, Generic)
|
||||
import IHaskell.Display.Diagrams.ImgSize
|
||||
|
||||
instance IHaskellDisplay (ManuallySized (QDiagram Cairo V2 Double Any)) where
|
||||
display renderable = do
|
||||
|
@ -0,0 +1,11 @@
|
||||
{-# LANGUAGE DeriveFunctor, DeriveGeneric #-}
|
||||
|
||||
module IHaskell.Display.Diagrams.ImgSize where
|
||||
|
||||
import GHC.Generics (Generic)
|
||||
|
||||
data ManuallySized a = ManuallySized
|
||||
{ contentToDisplay :: a
|
||||
, imgManualWidth :: Double
|
||||
, imgManualHeight :: Double
|
||||
} deriving (Show, Functor, Generic)
|
@ -52,6 +52,7 @@ library
|
||||
|
||||
-- Modules included in this library but not exported.
|
||||
other-modules: IHaskell.Display.Diagrams.Animation
|
||||
IHaskell.Display.Diagrams.ImgSize
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.6 && <5,
|
||||
|
Loading…
x
Reference in New Issue
Block a user