From: rexim Date: Mon, 15 Oct 2018 19:01:20 +0000 (+0700) Subject: (#425) Fail svg2rect on missing player and background X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=ca7792e3855e0055a6ddcc8848b76cbb5c59f8f1;p=nothing.git (#425) Fail svg2rect on missing player and background --- diff --git a/devtools/svg2rects.xqe b/devtools/svg2rects.xqe index b360eb3b..e944b942 100644 --- a/devtools/svg2rects.xqe +++ b/devtools/svg2rects.xqe @@ -65,7 +65,11 @@ let $backplatforms := for $rect in $rects where matches($rect/@id, "^backrect.*" $rect/@height, " ", replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1") ) -return ( +return if (count($player) = 0) then ( + error(QName('', 'ERROR'), 'Position of the Player is not defined. Create a rectangle with id "player"') +) else if (count($background) = 0) then ( + error(QName('', 'ERROR'), 'Color of the Background is not defined. Create a rectangle with id "background"') +) else ( $background, $player, count($platforms),