From 1a7706e187639c058e8d894bc18ba3e78aacf900 Mon Sep 17 00:00:00 2001 From: George Lemon Date: Sun, 31 Mar 2024 02:34:51 +0200 Subject: [PATCH] update Signed-off-by: George Lemon --- src/iconim.nim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/iconim.nim b/src/iconim.nim index 2d28e16..2f37912 100644 --- a/src/iconim.nim +++ b/src/iconim.nim @@ -7,10 +7,12 @@ import std/[os, tables, strtabs, xmltree, xmlparser, json] from std/strutils import indent, join +export XmlAttributes + type SVGIcon = ref object path, code: string - attrs: XmlAttributes + attrs*: XmlAttributes Library = ref object name: string @@ -96,6 +98,11 @@ proc size*(svg: SVGIcon, s: int): SVGIcon = svg.attrs["height"] = $s result = svg +proc strokeWidth*(svg: SVGIcon, i: int): SVGIcon = + ## Change `stroke-width` attribute value + svg.attrs["stroke-width"] = $i + result = svg + proc `$`*(svg: SVGIcon): string = if svg != nil: result = "" & svg.code & ""