summaryrefslogtreecommitdiff
path: root/lib/Properties.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Properties.hs')
-rw-r--r--lib/Properties.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs
index c057b63..a326e30 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -211,7 +211,7 @@ checkLayer = do
forM_ (getProperties layer) checkObjectGroupProperty
unless (layerName layer == "floorLayer") $
- when (null publicObjects || publicObjects == Just mempty) $
+ when (null (layerObjects layer) || layerObjects layer == Just mempty) $
warn "objectgroup layer (which aren't the floorLayer) \
\are useless if they are empty."
@@ -234,16 +234,17 @@ checkObjectProperty obj p@(Property name _) = case name of
unwrapString p $ \str ->
unwrapBadgeToken str $ \token -> do
case obj of
- ObjectPoint {..} ->
- offersBadge (Badge token (BadgePoint objectX objectY))
- ObjectRectangle {..} ->
- 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."
+ ObjectRectangle {..} ->
+ if objectEllipse == Just True
+ then complain "ellipses are not supported."
+ else offersBadge
+ $ Badge token $ case (objectWidth, objectHeight) of
+ (Just w, Just h) | w /= 0 && h /= 0 ->
+ BadgeRect objectX objectY w h
+ _ -> BadgePoint objectX objectY
_ -> warn $ "unknown object property " <> prettyprint name <> "."