diff --git a/samples/load_images.rb b/samples/load_images.rb index 095c3a3..3678974 100644 --- a/samples/load_images.rb +++ b/samples/load_images.rb @@ -60,5 +60,13 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do png mask: :magenta, file: 'shiny-purse.png', x: 650, y: 950 + # Note that this method does nothing, even though it would normally fill up + # the card. force_id: true looks to the id field to be non-empty to render. + # This is useful if you have multiple different icons in one SVG file, + # but sometimes want to use none. + # e.g. id: [:attack, :defend, nil] + svg file: 'spanner.svg', width: :deck, height: :deck, + force_id: true, id: '' # <-- the important part + save prefix: 'load_images_', format: :png end diff --git a/spec/data/samples/load_images.rb.txt b/spec/data/samples/load_images.rb.txt index 9fd4ced..6f4b0af 100644 --- a/spec/data/samples/load_images.rb.txt +++ b/spec/data/samples/load_images.rb.txt @@ -121,7 +121,13 @@ cairo: translate([650, 950]) cairo: rotate([0]) cairo: translate([-650, -950]) cairo: set_source([ImageSurface, 650, 950]) -cairo: set_source_color([:magenta]) +cairo: set_source_color(["magenta"]) cairo: mask([ImageSurface, 650, 950]) cairo: restore([]) +cairo: save([]) +cairo: translate([0, 0]) +cairo: rotate([0]) +cairo: scale([6.4453125, 8.7890625]) +cairo: render_rsvg_handle([RSVG::Handle, "#"]) +cairo: restore([]) surface: write_to_png(["_output/load_images_00.png"])