diff options
| author | Fuwn <[email protected]> | 2024-05-14 02:30:47 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-05-14 02:30:47 -0700 |
| commit | f3f73ed3b35a90959af1d545921ac31227920d0c (patch) | |
| tree | 240bc729562e53e86db563b2858c8d4b147c9135 /src | |
| parent | 3b5a3b7726223e07ea3b6637d21a4f5b921d2ccd (diff) | |
| download | mayu-f3f73ed3b35a90959af1d545921ac31227920d0c.tar.xz mayu-f3f73ed3b35a90959af1d545921ac31227920d0c.zip | |
fix(svg): fixed height
Diffstat (limited to 'src')
| -rw-r--r-- | src/svg.gleam | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/svg.gleam b/src/svg.gleam index 317c2d8..81494a1 100644 --- a/src/svg.gleam +++ b/src/svg.gleam @@ -6,7 +6,7 @@ import image import simplifile type XmlImages { - XmlImages(xml: String, width: Int) + XmlImages(xml: String, width: Int, height: Int) } fn image(data, dimensions: image.ImageDimensions, width, extension) { @@ -23,7 +23,7 @@ fn image(data, dimensions: image.ImageDimensions, width, extension) { fn images(theme, digits, width, height, svgs) { case digits { - [] -> XmlImages(string_builder.to_string(svgs), width) + [] -> XmlImages(string_builder.to_string(svgs), width, height) [digit, ..rest] -> { let extension = case theme { "asoul" | "gelbooru" | "moebooru" | "rule34" | "urushi" -> "gif" @@ -53,10 +53,10 @@ fn images(theme, digits, width, height, svgs) { image(data, dimensions, width, extension), ), ) - Error(_) -> XmlImages(string_builder.to_string(svgs), width) + Error(_) -> XmlImages(string_builder.to_string(svgs), width, height) } } - Error(_) -> XmlImages(string_builder.to_string(svgs), width) + Error(_) -> XmlImages(string_builder.to_string(svgs), width, height) } } } @@ -82,7 +82,7 @@ pub fn xml(theme, number) { "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> <svg - height=\"{height}\" + height=\"" <> int.to_string(xml.height) <> "\" style=\"image-rendering: pixelated;\" version=\"1.1\" width=\"" <> int.to_string(xml.width) <> "\" |