diff --git a/Sources/Generator/Generators/HTMLElementsGenerator.swift b/Sources/Generator/Generators/HTMLElementsGenerator.swift
index 8c1b87f..942bfbc 100644
--- a/Sources/Generator/Generators/HTMLElementsGenerator.swift
+++ b/Sources/Generator/Generators/HTMLElementsGenerator.swift
@@ -4,10 +4,6 @@ typealias SVGSelection = (x: Int, y: Int, width: Int, height: Int)
struct HTMLElementsGenerator {
- init() {
-
- }
-
func make(title: String, suffix: String) -> String {
"\(title)\(suffix)"
}
@@ -40,16 +36,17 @@ struct HTMLElementsGenerator {
}
func image(file: String, width: Int, height: Int, altText: String) -> String {
- """
+ let ratio = Float(width) / Float(height)
+ return """
-
+
"""
}
- func svgImage(file: String, part: SVGSelection, width: Int, height: Int, altText: String) -> String {
- let path = "\(file)#svgView(viewBox(\(part.x),\(part.y),\(part.width),\(part.height))"
- return image(file: path, width: width, height: height, altText: altText)
+ func svgImage(file: String, part: SVGSelection, altText: String) -> String {
+ let path = "\(file)#svgView(viewBox(\(part.x), \(part.y), \(part.width), \(part.height)))"
+ return image(file: path, width: part.width, height: part.height, altText: altText)
}
func downloadButtons(_ buttons: [(file: String, text: String, downloadName: String?)]) -> String {
diff --git a/Sources/Generator/Generators/PageContentGenerator.swift b/Sources/Generator/Generators/PageContentGenerator.swift
index d18d552..6f7fc8b 100644
--- a/Sources/Generator/Generators/PageContentGenerator.swift
+++ b/Sources/Generator/Generators/PageContentGenerator.swift
@@ -236,7 +236,7 @@ struct PageContentGenerator {
return factory.html.image(file: file, width: width, height: height, altText: altText)
}
let part = SVGSelection(x, y, partWidth, partHeight)
- return factory.html.svgImage(file: file, part: part, width: width, height: height, altText: altText)
+ return factory.html.svgImage(file: file, part: part, altText: altText)
}
private func handleFile(page: Element, file: String, fileExtension: String) -> String {