summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Badges.hs5
-rw-r--r--lib/Properties.hs9
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/Badges.hs b/lib/Badges.hs
index b78f08d..efb4e77 100644
--- a/lib/Badges.hs
+++ b/lib/Badges.hs
@@ -26,7 +26,6 @@ data BadgeArea =
, areaY :: Double
, areaWidth :: Double
, areaHeight :: Double
- , areaIsEllipse :: Bool
}
deriving (Ord, Eq, Generic, Show)
@@ -61,9 +60,7 @@ badgeJsonArray (Badge token area) =
, "y" .= areaY
, "width" .= areaWidth
, "height" .= areaHeight
- , "type" .= if areaIsEllipse
- then A.String "ellipse"
- else A.String "rectangle"
+ , "type" .= A.String "rectangle"
]
badgeJson :: FilePath -> Badge -> A.Value
diff --git a/lib/Properties.hs b/lib/Properties.hs
index ce79ff8..0049d4e 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -231,11 +231,10 @@ checkObjectGroupProperty p@(Property name _) = case name of
ObjectPoint {..} ->
offersBadge (Badge token (BadgePoint objectX objectY))
ObjectRectangle {..} ->
- offersBadge (Badge token area)
- where area = BadgeRect
- objectX objectY
- objectWidth objectHeight
- (objectEllipse == Just True)
+ if isJust objectEllipse
+ then offersBadge
+ $ Badge token (BadgeRect objectX objectY objectWidth objectHeight)
+ else complain "ellipses are not supported."
ObjectPolygon {} -> complain "polygons are not supported."
ObjectPolyline {} -> complain "polylines are not supported."
ObjectText {} -> complain "cannot use texts to define badge areas."