PenroseKiteDart 1.8 → 1.8.1
raw patch · 4 files changed
+15/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- PenroseKiteDart.cabal +1/−1
- src/Tgraph/Prelude.hs +1/−1
- src/TileLib.hs +10/−4
CHANGELOG.md view
@@ -1,5 +1,8 @@ # Revision history for PenroseKiteDart +## version v1.8.1++Fixed bug (introduced in 1.8) rotations and scales not behaving as described. ## version v1.8
PenroseKiteDart.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: PenroseKiteDart-version: 1.8+version: 1.8.1 synopsis: Library to explore Penrose's Kite and Dart Tilings. description: Library to explore Penrose's Kite and Dart Tilings using Haskell Diagrams. Please see README.md category: Graphics
src/Tgraph/Prelude.hs view
@@ -1339,7 +1339,7 @@ alignBefore :: (VPatch -> a) -> (Vertex,Vertex) -> Tgraph -> a alignBefore = flip aligning --- | makeAlignedVP (a,b) g - make a VPatch from g oriented with centre on a and b aligning on the x-axis.+-- | alignedVP (a,b) g - make a VPatch from g oriented with centre on a and b aligning on the x-axis. -- Will raise an error if either a or b is not a vertex in g. alignedVP:: HasGraph a => (Vertex,Vertex) -> a -> VPatch alignedVP vs = alignXaxis vs . makeVP
src/TileLib.hs view
@@ -467,19 +467,25 @@ -- It will raise an error if the integer list is longer than the list of items to be rotated. -- (Rotations by an angle are anti-clockwise) rotations :: (Transformable a, V a ~ V2, N a ~ Double) => [Int] -> [a] -> [a]-rotations ns xs = if length ns > length xs+rotations (n:ns) (d:ds) = rotate (ttangle n) d: rotations ns ds+rotations [] ds = ds+rotations _ [] = error "rotations: too many rotation integers"+{- rotations ns xs = if length ns > length xs then error "rotations: too many rotation integers" else zipWith (rotate . ttangle) ns xs-+ -} -- |scales takes a list of doubles for respective scalings of items in the second list (things to be scaled). -- This includes Diagrams, Pieces, Patches, VPatches. -- The list of doubles can be shorter than the list of items - the remaining items are left unscaled. -- It will raise an error if the integer list is longer than the list of items to be scaled. scales :: (Transformable a, V a ~ V2, N a ~ Double) => [Double] -> [a] -> [a]-scales ss xs = if length ss > length xs+scales (s:ss) (d:ds) = scale s d: scales ss ds+scales [] ds = ds+scales _ [] = error "scales: too many scalars"+{- scales ss xs = if length ss > length xs then error "scales: too many scalars" else zipWith scale ss xs-+ -} -- |increasing scales by a factor of phi along a list starting with 1. phiScales:: (Transformable a, V a ~ V2, N a ~ Double) => [a] -> [a] phiScales = phiScaling 1