From 40ac4651f1cc56520f8bd14b945d10752ea5fe6e Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Mon, 11 Apr 2016 20:51:11 -0400 Subject: [PATCH] samples: documenting a hack related to #136 --- samples/cairo_access.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/samples/cairo_access.rb b/samples/cairo_access.rb index dd4b21e..b0a5acd 100644 --- a/samples/cairo_access.rb +++ b/samples/cairo_access.rb @@ -24,5 +24,16 @@ Squib::Deck.new(cards: 2) do cairo_context.fill end + # Or modify the coordinate system for all (most?) future calls + # Could be handy for a dynamic bleed + each do |card| + # note how this does NOT use save/restore. + # again... this "feature" lives in the Land of Undefined Behavior + card.cairo_context.translate(500, 500) + end + rect x: 0, y: 0, # actually 500, 500 + width: 50, height: 50, fill_color: :red + + save_png prefix: 'cairo_access_' end