Allow negative coordinates in sprue coordinates

Fixes #336
This commit is contained in:
Andy Meneely
2021-08-11 15:00:54 -04:00
parent 62a2d54ed2
commit c795852fa8
7 changed files with 43 additions and 3 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
module Squib
module Sprues
UNIT_REGEX = /^(\d*[.])?\d+(in|cm|mm)$/
ROTATE_REGEX = /^(\d*[.])?\d+(deg|rad)?$/
COORD_REGEX = /^\-?(\d*[.])?\d+(in|cm|mm)$/
ROTATE_REGEX = /^\-?(\d*[.])?\d+(deg|rad)?$/
SCHEMA = {
'sheet_width' => UNIT_REGEX,
'sheet_height' => UNIT_REGEX,
@@ -35,8 +36,8 @@ module Squib
}]]
},
'cards' => [[{
'x' => UNIT_REGEX,
'y' => UNIT_REGEX,
'x' => COORD_REGEX,
'y' => COORD_REGEX,
'rotate' => [
:optional, Numeric,
ClassyHash::G.enum(:clockwise, :counterclockwise, :turnaround),