lib/rabbit/renderer/engine/cairo.rb in rabbit-2.1.9 vs lib/rabbit/renderer/engine/cairo.rb in rabbit-2.2.0

- old
+ new

@@ -184,11 +184,16 @@ x, y = from_screen(x, y) @context.save do set_source(color, params) set_line_options(params) @context.move_to(x, y) - @context.show_pango_layout(layout) + if params[:stroke] + @context.pango_layout_path(layout) + apply_cairo_action(false, params) + else + @context.show_pango_layout(layout) + end end end def draw_pixbuf(pixbuf, x, y, params={}) x, y = from_screen(x, y) @@ -261,9 +266,19 @@ height = (params[:height] || h).to_f @context.save do @context.translate(x, y) @context.scale(width / w, height / h) @context.render_poppler_page(page) + end + end + + def draw_link(uri) + if @context.respond_to?(:tag) + @context.tag(::Cairo::Tag::LINK, "uri='#{uri}'") do + yield + end + else + yield end end def make_layout(text) attributes, text = Pango.parse_markup(text)