From b123a132ef6f035187fae51c6b64fca0d5f8de1d Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Wed, 1 Apr 2015 10:19:46 -0400 Subject: [PATCH] Better debugging to fix this travis issue --- lib/squib/graphics/cairo_context_wrapper.rb | 2 +- lib/squib/graphics/text.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/squib/graphics/cairo_context_wrapper.rb b/lib/squib/graphics/cairo_context_wrapper.rb index c5ee5d3..9595485 100644 --- a/lib/squib/graphics/cairo_context_wrapper.rb +++ b/lib/squib/graphics/cairo_context_wrapper.rb @@ -22,7 +22,7 @@ module Squib :show_pango_layout, :rounded_rectangle, :set_line_width, :stroke, :fill, :set_source, :scale, :render_rsvg_handle, :circle, :triangle, :line_to, :operator=, :show_page, :clip, :transform, :mask, :create_pango_layout, - :antialias=, :curve_to, :get_matrix + :antialias=, :curve_to, :matrix # :nodoc: # @api private diff --git a/lib/squib/graphics/text.rb b/lib/squib/graphics/text.rb index ce489d2..1d29ada 100644 --- a/lib/squib/graphics/text.rb +++ b/lib/squib/graphics/text.rb @@ -138,6 +138,7 @@ module Squib cc.translate(x,y) cc.rotate(angle) cc.move_to(0, 0) + initial_matrix = cc.matrix.to_a font_desc = Pango::FontDescription.new(font) font_desc.size = font_size * Pango::SCALE unless font_size.nil? @@ -161,12 +162,15 @@ module Squib cc.move_to(0, vertical_start) cc.update_pango_layout(layout) + before_show = cc.matrix.to_a cc.show_pango_layout(layout) begin embed_draws.each { |ed| ed[:draw].call(self, ed[:x], ed[:y] + vertical_start) } rescue Exception => e puts "====EXCEPTION!====" - puts "Cairo matrix: #{cc.get_matrix}" + puts "Initial matrix: #{initial_matrix}" + puts "Before show matrix: #{before_show}" + puts "Current matrix: #{cc.matrix.to_a}" puts e puts "==================" end