diff --git a/color_cards_sprite.svg b/color_cards_sprite.svg
index 61989ef..2ac0cdc 100644
--- a/color_cards_sprite.svg
+++ b/color_cards_sprite.svg
@@ -283,6 +283,7 @@
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
diff --git a/lib/mtg_card_maker.rb b/lib/mtg_card_maker.rb
index 0e9bbdf..6247e08 100644
--- a/lib/mtg_card_maker.rb
+++ b/lib/mtg_card_maker.rb
@@ -161,7 +161,7 @@ class Template
def initialize(width: CARD_WIDTH, height: CARD_HEIGHT, embed_font: false)
@width = width
@height = height
- @svg = Victor::SVG.new width: width, height: height
+ @svg = Victor::SVG.new width: width, height: height, viewBox: "0 0 #{width} #{height}"
embed_font(embed: embed_font)
end
diff --git a/lib/mtg_card_maker/sprite_sheet_builder.rb b/lib/mtg_card_maker/sprite_sheet_builder.rb
index 08c6d46..5d1a098 100644
--- a/lib/mtg_card_maker/sprite_sheet_builder.rb
+++ b/lib/mtg_card_maker/sprite_sheet_builder.rb
@@ -65,7 +65,12 @@ def add_card_to_sprite(xml, card_file, index, embed_font)
return unless svg_element
xml.g(transform: "translate(#{position[:x]}, #{position[:y]})") do
- add_card_children(xml, svg_element, embed_font)
+ # Add the card with its own viewBox for proper scaling
+ xml.svg(viewBox: "0 0 #{CARD_WIDTH} #{CARD_HEIGHT}",
+ width: CARD_WIDTH,
+ height: CARD_HEIGHT) do
+ add_card_children(xml, svg_element, embed_font)
+ end
end
end
diff --git a/output_card.svg b/output_card.svg
index 51231e5..4c9fb7c 100644
--- a/output_card.svg
+++ b/output_card.svg
@@ -1,4 +1,4 @@
-