aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-05-14 09:30:47 +0000
committerFuwn <[email protected]>2024-05-14 09:30:47 +0000
commit22eb8c620177ad1c8ac6ad769269096d22e7f8f0 (patch)
tree240bc729562e53e86db563b2858c8d4b147c9135 /src
parentdocs(gleam): bump version to 0.1.1 (diff)
downloadmayu-22eb8c620177ad1c8ac6ad769269096d22e7f8f0.tar.xz
mayu-22eb8c620177ad1c8ac6ad769269096d22e7f8f0.zip
fix(svg): fixed height
Diffstat (limited to 'src')
-rw-r--r--src/svg.gleam10
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) <> "\"