diff options
author | stuebinm | 2021-12-16 00:22:20 +0100 |
---|---|---|
committer | stuebinm | 2021-12-16 00:22:20 +0100 |
commit | f74bb6eb321f9a22be5cbdb6c92ed74e09226b18 (patch) | |
tree | 6e5f5895b4b16fc5a79cf141706451e3d63e9acf /lib | |
parent | c89872d393566ab414301cc84f30b8e8d08900b2 (diff) |
we don't support ellipses
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Badges.hs | 5 | ||||
-rw-r--r-- | lib/Properties.hs | 9 |
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." |