Avoid shadowing of variables

This commit is contained in:
hasufell 2014-10-06 21:12:18 +02:00
parent 8547122be6
commit c35eb704d3
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

28
Gtk.hs
View File

@ -186,23 +186,23 @@ drawDiag' fp mygui =
dw <- widgetGetDrawWindow (da mygui) dw <- widgetGetDrawWindow (da mygui)
adjustment <- rangeGetAdjustment (hs mygui) adjustment <- rangeGetAdjustment (hs mygui)
scaleVal <- adjustmentGetValue adjustment scaleVal <- adjustmentGetValue adjustment
xlD <- entryGetText (xl mygui) xlD' <- entryGetText (xl mygui)
xuD <- entryGetText (xu mygui) xuD' <- entryGetText (xu mygui)
ylD <- entryGetText (yl mygui) ylD' <- entryGetText (yl mygui)
yuD <- entryGetText (yu mygui) yuD' <- entryGetText (yu mygui)
-- clear drawing area -- clear drawing area
clearDiag mygui clearDiag mygui
let xD = (,) <$> readMaybe xlD <*> readMaybe xuD :: Maybe (Double, let xD = (,) <$> readMaybe xlD' <*> readMaybe xuD' :: Maybe (Double,
Double) Double)
yD = (,) <$> readMaybe ylD <*> readMaybe yuD :: Maybe (Double, yD = (,) <$> readMaybe ylD' <*> readMaybe yuD' :: Maybe (Double,
Double) Double)
case (xD, yD) of case (xD, yD) of
(Just xD', Just yD') -> do (Just xD', Just yD') -> do
let (_, r) = renderDia Cairo let (_, r) = renderDia Cairo
(CairoOptions "" (Width 600) SVG False) (CairoOptions "" (Width 600) SVG False)
(diagFromString (def{t = scaleVal, (diagS (def{t = scaleVal,
dX = xD', dX = xD',
dY = yD'}) dY = yD'})
mesh) mesh)
@ -223,19 +223,19 @@ saveDiag' fp mygui =
mesh <- readFile fp mesh <- readFile fp
adjustment <- rangeGetAdjustment (hs mygui) adjustment <- rangeGetAdjustment (hs mygui)
scaleVal <- adjustmentGetValue adjustment scaleVal <- adjustmentGetValue adjustment
xlD <- entryGetText (xl mygui) xlD' <- entryGetText (xl mygui)
xuD <- entryGetText (xu mygui) xuD' <- entryGetText (xu mygui)
ylD <- entryGetText (yl mygui) ylD' <- entryGetText (yl mygui)
yuD <- entryGetText (yu mygui) yuD' <- entryGetText (yu mygui)
let xD = (,) <$> readMaybe xlD <*> readMaybe xuD :: Maybe (Double, let xD = (,) <$> readMaybe xlD' <*> readMaybe xuD' :: Maybe (Double,
Double) Double)
yD = (,) <$> readMaybe ylD <*> readMaybe yuD :: Maybe (Double, yD = (,) <$> readMaybe ylD' <*> readMaybe yuD' :: Maybe (Double,
Double) Double)
case (xD, yD) of case (xD, yD) of
(Just xD', Just yD') -> do (Just xD', Just yD') -> do
renderCairo "out.svg" (Width 600) renderCairo "out.svg" (Width 600)
(diagFromString (def{t = scaleVal, (diagS (def{t = scaleVal,
dX = xD', dX = xD',
dY = yD'}) dY = yD'})
mesh) mesh)