Skip to content

Commit

Permalink
change default measure to Normalized
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyrosenbluth committed Apr 2, 2014
1 parent 027549e commit 9fc01b6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Diagrams/TwoD.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module Diagrams.TwoD
-- * Text
, text, topLeftText, alignedText, baselineText
, font, setFontSize, italic, oblique, bold
, fontSize, fontSizeO, fontSizeL, fontSizeN
, fontSize, fontSizeO, fontSizeL, fontSizeN, fontSizeG

-- * Images
, Image, image
Expand Down
4 changes: 2 additions & 2 deletions src/Diagrams/TwoD/Arrow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ getHeadSize (HeadSize (Last s)) = s

-- | Default for 'headSize'.
hs :: (HasStyle a, V a ~ R2) => Double -> a -> a
hs = hsG
hs = hsN

-- | A convenient synonym for 'headSize (Global w)'.
hsG :: (HasStyle a, V a ~ R2) => Double -> a -> a
Expand Down Expand Up @@ -352,7 +352,7 @@ getTailSize (TailSize (Last s)) = s

-- | Default for 'tailSize'
ts :: (HasStyle a, V a ~ R2) => Double -> a -> a
ts = tsG
ts = tsN

-- | A convenient synonym for 'tailSize (Global w)'.
tsG :: (HasStyle a, V a ~ R2) => Double -> a -> a
Expand Down
16 changes: 8 additions & 8 deletions src/Diagrams/TwoD/Attributes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ lineWidthA = applyGTAttr

-- | Default for 'lineWidth'.
lw :: (HasStyle a, V a ~ R2) => Double -> a -> a
lw = lwG
lw = lwN

-- | A convenient synonym for 'lineWidth (Global w)'.
lwG :: (HasStyle a, V a ~ R2) => Double -> a -> a
Expand All @@ -93,12 +93,12 @@ lwL w = lineWidth (Local w)
-- | Standard line widths.
ultraThin, veryThin, thin, medium, thick, veryThick
:: (HasStyle a, V a ~ R2) => a -> a
ultraThin = lwO 0.25
veryThin = lwO 0.5
thin = lwO 1
medium = lwO 2
thick = lwO 4
veryThick = lwO 5
ultraThin = lwN 0.05
veryThin = lwN 0.1
thin = lwN 0.2
medium = lwN 0.4
thick = lwN 0.75
veryThick = lwN 1

-----------------------------------------------------------------
-- Dashing ----------------------------------------------------
Expand Down Expand Up @@ -136,7 +136,7 @@ setDashing ds offs = applyGTAttr (DashingA (Last (Dashing ds offs)))

-- | Default for 'setDashing'.
dashing :: (HasStyle a, V a ~ R2) => [Double] -> Double -> a -> a
dashing = dashingG
dashing = dashingN

-- | A convenient synonym for 'setDashing (Global w)'.
dashingG :: (HasStyle a, V a ~ R2) => [Double] -> Double -> a -> a
Expand Down
10 changes: 7 additions & 3 deletions src/Diagrams/TwoD/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Diagrams.TwoD.Text (
, Font(..), getFont, font
-- ** Font size
, FontSize(..), getFontSize, setFontSize, fontSizeA
, fontSize, fontSizeN, fontSizeO, fontSizeL
, fontSize, fontSizeN, fontSizeO, fontSizeL, fontSizeG
-- ** Font slant
, FontSlant(..), FontSlantA, getFontSlant, fontSlant, italic, oblique
-- ** Font weight
Expand Down Expand Up @@ -187,9 +187,13 @@ getFontSize (FontSize (Last s)) = s
setFontSize :: (HasStyle a, V a ~ R2) => Measure R2 -> a -> a
setFontSize = applyGTAttr . FontSize . Last

-- | A convenient synonym for 'setFontSize (Global w)'.
-- | Default for 'FontSize'.
fontSize :: (HasStyle a, V a ~ R2) => Double -> a -> a
fontSize w = setFontSize (Global w)
fontSize = fontSizeN

-- | A convenient synonym for 'setFontSize (Global w)'.
fontSizeG :: (HasStyle a, V a ~ R2) => Double -> a -> a
fontSizeG w = setFontSize (Global w)

-- | A convenient synonym for 'setFontSize (Normalized w)'.
fontSizeN :: (HasStyle a, V a ~ R2) => Double -> a -> a
Expand Down

0 comments on commit 9fc01b6

Please sign in to comment.