Browse Source

tests updated, bug fix.

SakiKawasaki 5 years ago
parent
commit
0b8d66f22b

+ 1 - 1
badgemaker.nimble

@@ -1,7 +1,7 @@
 [Package]
 name = "badgemaker"
 author = "Ethosa"
-version = "0.0.4"
+version = "0.0.5"
 description = "The Nim badgemaker tool."
 license = "AGPLv3"
 srcDir = "badgemaker"

+ 2 - 3
badgemaker/badgemaker.nim

@@ -90,9 +90,8 @@ proc `$`*(badge: BadgeRef): string =
 
   main.add newXMLTree(
     "rect", [], {
-      "x": "0", "y": "0", "width": $labelw, "height": $badge.height,
-      "rx": radius,
-      "ry": radius,
+      "x": "0", "y": "0", "width": $(labelw - badge.font_size),
+      "height": $badge.height, "rx": radius, "ry": radius,
       "style": "fill:" & badge.label_color
     }.toXMLAttributes)
   main.add newXMLTree(

BIN
tests/test1.exe


+ 1 - 1
tests/test1.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#212121" width="90" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#212121" width="78" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:fuchsia" width="50" y="0" x="64" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="108" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h120v20H0z" />

BIN
tests/test10.exe


+ 1 - 1
tests/test10.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="230" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#282A36" width="218" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:fuchsia" width="30" y="0" x="184" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="208" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h220v20H0z" />

BIN
tests/test11.exe


+ 1 - 1
tests/test11.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#77dd77" width="110" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#77dd77" width="98" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:#212121" width="10" y="0" x="84" rx="0" height="20" ry="0" />
     <rect style="fill:#212121" width="12" y="0" x="88" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h100v20H0z" />

BIN
tests/test2.exe


+ 1 - 1
tests/test2.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="50" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#282A36" width="38" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:#f1fa8c" width="82" y="0" x="42" rx="0" height="20" ry="0" />
     <rect style="fill:#f1fa8c" width="12" y="0" x="118" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h130v20H0z" />

BIN
tests/test3.exe


+ 1 - 1
tests/test3.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity="0" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="50" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#282A36" width="38" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:#f1fa8c" width="72" y="0" x="42" rx="0" height="20" ry="0" />
     <rect style="fill:#f1fa8c" width="12" y="0" x="108" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h120v20H0z" />

BIN
tests/test4.exe


+ 1 - 1
tests/test4.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="50" y="0" x="0" rx="0" height="20" ry="0" />
+    <rect style="fill:#282A36" width="38" y="0" x="0" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="76" y="0" x="38" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="108" rx="0" height="20" ry="0" />
     <path fill="url(#gradient)" d="M0 0h120v20H0z" />

BIN
tests/test5.exe


+ 1 - 1
tests/test5.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity="0" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="50" y="0" x="0" rx="0" height="20" ry="0" />
+    <rect style="fill:#282A36" width="38" y="0" x="0" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="76" y="0" x="38" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="108" rx="0" height="20" ry="0" />
     <path fill="url(#gradient)" d="M0 0h120v20H0z" />

BIN
tests/test6.exe


+ 1 - 1
tests/test6.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity="0" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="70" y="0" x="0" rx="0" height="20" ry="0" />
+    <rect style="fill:#282A36" width="58" y="0" x="0" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="56" y="0" x="58" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="108" rx="0" height="20" ry="0" />
     <path fill="url(#gradient)" d="M0 0h120v20H0z" />

BIN
tests/test7.exe


+ 1 - 1
tests/test7.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="230" y="0" x="0" rx="4" height="20" ry="4" />
+    <rect style="fill:#282A36" width="218" y="0" x="0" rx="4" height="20" ry="4" />
     <rect style="fill:fuchsia" width="30" y="0" x="184" rx="0" height="20" ry="0" />
     <rect style="fill:fuchsia" width="12" y="0" x="208" rx="4" height="20" ry="4" />
     <path fill="url(#gradient)" d="M0 0h220v20H0z" />

BIN
tests/test8.exe


File diff suppressed because it is too large
+ 3 - 3
tests/test8.svg


BIN
tests/test9.exe


+ 1 - 1
tests/test9.svg

@@ -4,7 +4,7 @@
     <stop stop-opacity=".1" offset="1" />
   </linearGradient>
   <g mask="url(#gradient)">
-    <rect style="fill:#282A36" width="368" y="0" x="0" rx="4" height="32" ry="4" />
+    <rect style="fill:#282A36" width="350" y="0" x="0" rx="4" height="32" ry="4" />
     <rect style="fill:fuchsia" width="211" y="0" x="292" rx="0" height="32" ry="0" />
     <rect style="fill:fuchsia" width="18" y="0" x="494" rx="4" height="32" ry="4" />
     <path fill="url(#gradient)" d="M0 0h512v32H0z" />

Some files were not shown because too many files changed in this diff