Use cairo context wrapper for fill colors on marketing
Actually deliver what I promised Fixes #71dev
parent
a86974d5b8
commit
0154b13e68
|
|
@ -1,3 +1,5 @@
|
||||||
|
require 'squib/graphics/cairo_context_wrapper'
|
||||||
|
|
||||||
module Squib
|
module Squib
|
||||||
class Deck
|
class Deck
|
||||||
|
|
||||||
|
|
@ -29,8 +31,8 @@ module Squib
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
x, y, w, h = cxt.target.ink_extents # I love Ruby assignment ;)
|
x, y, w, h = cxt.target.ink_extents # I love Ruby assignment ;)
|
||||||
png_cxt = Cairo::Context.new(Cairo::ImageSurface.new(w + 2*margin, h + 2*margin))
|
png_cxt = Squib::Graphics::CairoContextWrapper.new(Cairo::Context.new(Cairo::ImageSurface.new(w + 2*margin, h + 2*margin)))
|
||||||
png_cxt.set_source_color(fill_color)
|
png_cxt.set_source_squibcolor(fill_color)
|
||||||
png_cxt.paint
|
png_cxt.paint
|
||||||
png_cxt.translate(-x + margin, -y + margin)
|
png_cxt.translate(-x + margin, -y + margin)
|
||||||
png_cxt.set_source(cxt.target)
|
png_cxt.set_source(cxt.target)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
require 'squib/graphics/cairo_context_wrapper'
|
||||||
|
|
||||||
module Squib
|
module Squib
|
||||||
class Deck
|
class Deck
|
||||||
|
|
||||||
|
|
@ -16,8 +18,9 @@ module Squib
|
||||||
out_width = range.size * ((@width - 2*trim) * scale * offset) + 2*margin
|
out_width = range.size * ((@width - 2*trim) * scale * offset) + 2*margin
|
||||||
out_height = reflect_offset + (1.0 + reflect_percent) * (@height - 2*trim) + 2*margin
|
out_height = reflect_offset + (1.0 + reflect_percent) * (@height - 2*trim) + 2*margin
|
||||||
out_cc = Cairo::Context.new(Cairo::ImageSurface.new(out_width, out_height))
|
out_cc = Cairo::Context.new(Cairo::ImageSurface.new(out_width, out_height))
|
||||||
out_cc.set_source_color(fill_color)
|
wrapper = Squib::Graphics::CairoContextWrapper.new(out_cc)
|
||||||
out_cc.paint
|
wrapper.set_source_squibcolor(fill_color)
|
||||||
|
wrapper.paint
|
||||||
|
|
||||||
cards = range.collect { |i| @cards[i] }
|
cards = range.collect { |i| @cards[i] }
|
||||||
cards.each_with_index do |card, i|
|
cards.each_with_index do |card, i|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue