git » swiftpm » commit 0122ce0

Use fallback SVG that SVGView can handle

author Stephen Paul Weber
2025-04-17 03:47:13 UTC
committer Stephen Paul Weber
2025-04-17 03:47:13 UTC
parent de8075e37bfa303dae59610a29499f6930eaee74

Use fallback SVG that SVGView can handle

It fails on % for now, see https://github.com/exyte/SVGView/issues/74

Sources/c_snikket/src/snikket/Color.cpp +2 -2

diff --git a/Sources/c_snikket/src/snikket/Color.cpp b/Sources/c_snikket/src/snikket/Color.cpp
index c99d263..5c1a663 100644
--- a/Sources/c_snikket/src/snikket/Color.cpp
+++ b/Sources/c_snikket/src/snikket/Color.cpp
@@ -62,7 +62,7 @@ HXLINE(  20)		::String hex = ::snikket::Color_obj::forString(input).substr(1,nul
 HXLINE(  21)		::String encodedLetter;
 HXDLIN(  21)		try {
             			HX_STACK_CATCHABLE( ::Dynamic, 0);
-HXLINE(  21)			encodedLetter = ::StringTools_obj::urlEncode(letter);
+HXLINE(  21)			encodedLetter = ::StringTools_obj::urlEncode(letter.toUpperCase());
             		} catch( ::Dynamic _hx_e) {
             			if (_hx_e.IsClass<  ::Dynamic >() ){
             				HX_STACK_BEGIN_CATCH
@@ -73,7 +73,7 @@ HXLINE(  21)				encodedLetter = HX_(" ",20,00,00,00);
             				HX_STACK_DO_THROW(_hx_e);
             			}
             		}
-HXLINE(  26)		return (((((((HX_("data:image/svg+xml,<svg%20xmlns=\"http://www.w3.org/2000/svg\"%20version=\"1.1\"%20width=\"15\"%20height=\"15\"%20viewBox=\"0%200%2015%2015\">",89,4c,ea,28) + HX_("<rect%20style=\"fill:%23",82,0d,df,69)) + hex) + HX_(";\"%20width=\"15\"%20height=\"15\"%20x=\"0\"%20y=\"0\"%20/>",3b,1a,d3,d0)) + HX_("<text%20style=\"fill:%23ffffff;font-size:8px;font-family:sans-serif;\"%20text-anchor=\"middle\"%20dominant-baseline=\"central\"%20x=\"50%25\"%20y=\"50%25\">",50,f0,e7,75)) + encodedLetter) + HX_("</text>",9e,15,67,97)) + HX_("</svg>",4d,57,9c,59));
+HXLINE(  26)		return (((((((HX_("data:image/svg+xml,<svg%20xmlns=\"http://www.w3.org/2000/svg\"%20version=\"1.1\"%20width=\"15\"%20height=\"15\"%20viewBox=\"0%200%2015%2015\">",89,4c,ea,28) + HX_("<rect%20style=\"fill:%23",82,0d,df,69)) + hex) + HX_(";\"%20width=\"15\"%20height=\"15\"%20x=\"0\"%20y=\"0\"%20/>",3b,1a,d3,d0)) + HX_("<text%20style=\"fill:%23ffffff;font-size:8px;font-family:sans-serif;\"%20text-anchor=\"middle\"%20%20x=\"7.5\"%20y=\"10\">",89,2f,63,75)) + encodedLetter) + HX_("</text>",9e,15,67,97)) + HX_("</svg>",4d,57,9c,59));
             	}