Fix bug in get_pos() for negative positions
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 29 Nov 2023 22:44:50 +0000 (17:44 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 29 Nov 2023 22:44:50 +0000 (17:44 -0500)
fgen.sh

diff --git a/fgen.sh b/fgen.sh
index 5cdc85f..c4c6fe9 100755 (executable)
--- a/fgen.sh
+++ b/fgen.sh
@@ -68,7 +68,7 @@ function get_size()
 # Arg1: layer
 function get_pos()
 {
-    cat ${layers} | grep "${1}" | ${SED} "s/.*geometry:[0-9]\+x[0-9]\+\(+[0-9]\++[0-9]\+\),.*/\1/g"
+    cat ${layers} | grep "${1}" | ${SED} "s/.*geometry:[0-9]\+x[0-9]\+\([+-][0-9]\+[+-][0-9]\+\),.*/\1/g"
 }
 
 # Arg1: line