parent
8604ebd684
commit
e18084d963
|
|
@ -51,6 +51,10 @@ module Squib
|
||||||
@cairo_context.restore
|
@cairo_context.restore
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def finish!
|
||||||
|
@cairo_surface.finish
|
||||||
|
end
|
||||||
|
|
||||||
########################
|
########################
|
||||||
### BACKEND GRAPHICS ###
|
### BACKEND GRAPHICS ###
|
||||||
########################
|
########################
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ module Squib
|
||||||
if block_given?
|
if block_given?
|
||||||
instance_eval(&block) # here we go. wheeeee!
|
instance_eval(&block) # here we go. wheeeee!
|
||||||
end
|
end
|
||||||
|
@cards.each { |c| c.finish! }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Directly accesses the array of cards in the deck
|
# Directly accesses the array of cards in the deck
|
||||||
|
|
|
||||||
|
|
@ -128,3 +128,6 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 200, 0])
|
cairo: set_source([MockDouble, 200, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["./card_00.png"])
|
surface: write_to_png(["./card_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -243,3 +243,6 @@ cairo: restore([])
|
||||||
surface: write_to_png(["_output/basic_00.png"])
|
surface: write_to_png(["_output/basic_00.png"])
|
||||||
surface: write_to_png(["_output/basic_01.png"])
|
surface: write_to_png(["_output/basic_01.png"])
|
||||||
surface: write_to_png(["_output/basic_02.png"])
|
surface: write_to_png(["_output/basic_02.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -55,3 +55,5 @@ cairo: stroke([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/cairo_access_00.png"])
|
surface: write_to_png(["_output/cairo_access_00.png"])
|
||||||
surface: write_to_png(["_output/cairo_access_01.png"])
|
surface: write_to_png(["_output/cairo_access_01.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -81,3 +81,4 @@ cairo: show_pango_layout([MockDouble])
|
||||||
pango: ellipsized?([])
|
pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/gradient_00.png"])
|
surface: write_to_png(["_output/gradient_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ cairo: show_pango_layout([MockDouble])
|
||||||
pango: ellipsized?([])
|
pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/config_text_00.png"])
|
surface: write_to_png(["_output/config_text_00.png"])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: save([])
|
cairo: save([])
|
||||||
cairo: set_source_color(["black"])
|
cairo: set_source_color(["black"])
|
||||||
|
|
@ -70,3 +71,4 @@ cairo: stroke([])
|
||||||
pango: ellipsized?([])
|
pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/config_disable_text_00.png"])
|
surface: write_to_png(["_output/config_disable_text_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -56,3 +56,4 @@ cairo: paint([])
|
||||||
cairo: reset_clip([])
|
cairo: reset_clip([])
|
||||||
cairo: translate([-75, -75])
|
cairo: translate([-75, -75])
|
||||||
surface: finish([])
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@ pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/sample_csv_00.png"])
|
surface: write_to_png(["_output/sample_csv_00.png"])
|
||||||
surface: write_to_png(["_output/sample_csv_01.png"])
|
surface: write_to_png(["_output/sample_csv_01.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
|
|
@ -223,3 +225,7 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 300, 0])
|
cairo: set_source([MockDouble, 300, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/sample_csv_qty_00.png"])
|
surface: write_to_png(["_output/sample_csv_qty_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,9 @@ cairo: restore([])
|
||||||
surface: write_to_png(["_output/sample_excel_00.png"])
|
surface: write_to_png(["_output/sample_excel_00.png"])
|
||||||
surface: write_to_png(["_output/sample_excel_01.png"])
|
surface: write_to_png(["_output/sample_excel_01.png"])
|
||||||
surface: write_to_png(["_output/sample_excel_02.png"])
|
surface: write_to_png(["_output/sample_excel_02.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
|
|
@ -309,6 +312,10 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 300, 0])
|
cairo: set_source([MockDouble, 300, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/sample_xlsx_qty_00.png"])
|
surface: write_to_png(["_output/sample_xlsx_qty_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
|
|
@ -689,3 +696,9 @@ surface: write_to_png(["_output/sample_excel_resources_00.png"])
|
||||||
cairo: set_source([MockDouble, 0, 0])
|
cairo: set_source([MockDouble, 0, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/sample_excel_resources_01.png"])
|
surface: write_to_png(["_output/sample_excel_resources_01.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,7 @@ cairo: stroke([])
|
||||||
pango: ellipsized?([])
|
pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/embed_00.png"])
|
surface: write_to_png(["_output/embed_00.png"])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
|
|
@ -425,3 +426,6 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 200, 0])
|
cairo: set_source([MockDouble, 200, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/embed_multisheet_00.png"])
|
surface: write_to_png(["_output/embed_multisheet_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -34,3 +34,5 @@ pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/card_00.png"])
|
surface: write_to_png(["_output/card_00.png"])
|
||||||
surface: write_to_png(["_output/card_01.png"])
|
surface: write_to_png(["_output/card_01.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -332,3 +332,4 @@ cairo: translate([0, 0])
|
||||||
cairo: render_rsvg_handle([RSVG::Handle, "#"])
|
cairo: render_rsvg_handle([RSVG::Handle, "#"])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/load_images_00.png"])
|
surface: write_to_png(["_output/load_images_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -479,3 +479,6 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 200, 0])
|
cairo: set_source([MockDouble, 200, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/ranges_00.png"])
|
surface: write_to_png(["_output/ranges_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -584,3 +584,11 @@ cairo: translate([75, 75])
|
||||||
cairo: set_source([MockDouble])
|
cairo: set_source([MockDouble])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/hand_pretty.png"])
|
surface: write_to_png(["_output/hand_pretty.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ cairo: clip([])
|
||||||
cairo: set_source([MockDouble, -10, -10])
|
cairo: set_source([MockDouble, -10, -10])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/portrait_00.png"])
|
surface: write_to_png(["_output/portrait_00.png"])
|
||||||
|
surface: finish([])
|
||||||
cairo: antialias=(["subpixel"])
|
cairo: antialias=(["subpixel"])
|
||||||
cairo: save([])
|
cairo: save([])
|
||||||
cairo: set_source_color(["#aaa"])
|
cairo: set_source_color(["#aaa"])
|
||||||
|
|
@ -53,3 +54,4 @@ cairo: clip([])
|
||||||
cairo: set_source([MockDouble, -25, -25])
|
cairo: set_source([MockDouble, -25, -25])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/landscape_00.png"])
|
surface: write_to_png(["_output/landscape_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -1591,3 +1591,11 @@ cairo: set_dash([[5.0, 5.0]])
|
||||||
cairo: set_line_width([4.0])
|
cairo: set_line_width([4.0])
|
||||||
cairo: stroke([])
|
cairo: stroke([])
|
||||||
surface: finish([])
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -855,3 +855,19 @@ cairo: paint([])
|
||||||
cairo: set_source([MockDouble, 180, 75])
|
cairo: set_source([MockDouble, 180, 75])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
surface: write_to_png(["_output/save_sheet_range_01.png"])
|
surface: write_to_png(["_output/save_sheet_range_01.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -5936,3 +5936,7 @@ surface: write_to_png(["_output/showcase_individual_00.png"])
|
||||||
surface: write_to_png(["_output/showcase_individual_01.png"])
|
surface: write_to_png(["_output/showcase_individual_01.png"])
|
||||||
surface: write_to_png(["_output/showcase_individual_02.png"])
|
surface: write_to_png(["_output/showcase_individual_02.png"])
|
||||||
surface: write_to_png(["_output/showcase_individual_03.png"])
|
surface: write_to_png(["_output/showcase_individual_03.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -754,3 +754,4 @@ cairo: set_dash([[]])
|
||||||
cairo: stroke([])
|
cairo: stroke([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/shape_00.png"])
|
surface: write_to_png(["_output/shape_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -1153,3 +1153,6 @@ cairo: restore([])
|
||||||
surface: write_to_png(["_output/text_00.png"])
|
surface: write_to_png(["_output/text_00.png"])
|
||||||
surface: write_to_png(["_output/text_01.png"])
|
surface: write_to_png(["_output/text_01.png"])
|
||||||
surface: write_to_png(["_output/text_02.png"])
|
surface: write_to_png(["_output/text_02.png"])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -99,3 +99,4 @@ cairo: set_source([ImageSurface, 0, 0])
|
||||||
cairo: paint([0.5])
|
cairo: paint([0.5])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/tgc_sample_00.png"])
|
surface: write_to_png(["_output/tgc_sample_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -50,3 +50,4 @@ cairo: show_pango_layout([MockDouble])
|
||||||
pango: ellipsized?([])
|
pango: ellipsized?([])
|
||||||
cairo: restore([])
|
cairo: restore([])
|
||||||
surface: write_to_png(["_output/units_00.png"])
|
surface: write_to_png(["_output/units_00.png"])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ describe Squib::Deck do
|
||||||
card2 = instance_double(Squib::Card)
|
card2 = instance_double(Squib::Card)
|
||||||
expect(card1).to receive(:text).once
|
expect(card1).to receive(:text).once
|
||||||
expect(card2).to receive(:text).once
|
expect(card2).to receive(:text).once
|
||||||
|
expect(card1).to receive(:finish!).once
|
||||||
|
expect(card2).to receive(:finish!).once
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card1, card2]
|
@cards = [card1, card2]
|
||||||
text str: 'blah'
|
text str: 'blah'
|
||||||
|
|
@ -31,7 +33,9 @@ describe Squib::Deck do
|
||||||
it 'calls text on some cards with an integer' do
|
it 'calls text on some cards with an integer' do
|
||||||
card1 = instance_double(Squib::Card)
|
card1 = instance_double(Squib::Card)
|
||||||
card2 = instance_double(Squib::Card)
|
card2 = instance_double(Squib::Card)
|
||||||
|
expect(card1).to receive(:finish!).once
|
||||||
expect(card2).to receive(:text).once
|
expect(card2).to receive(:text).once
|
||||||
|
expect(card2).to receive(:finish!).once
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card1, card2]
|
@cards = [card1, card2]
|
||||||
text range: 1, str: 'blah'
|
text range: 1, str: 'blah'
|
||||||
|
|
@ -43,7 +47,10 @@ describe Squib::Deck do
|
||||||
card2 = instance_double(Squib::Card)
|
card2 = instance_double(Squib::Card)
|
||||||
card3 = instance_double(Squib::Card)
|
card3 = instance_double(Squib::Card)
|
||||||
expect(card1).to receive(:text).once
|
expect(card1).to receive(:text).once
|
||||||
|
expect(card1).to receive(:finish!).once
|
||||||
expect(card2).to receive(:text).once
|
expect(card2).to receive(:text).once
|
||||||
|
expect(card2).to receive(:finish!).once
|
||||||
|
expect(card3).to receive(:finish!).once
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
@cards = [card1, card2, card3]
|
@cards = [card1, card2, card3]
|
||||||
text range: 0..1, str: 'blah'
|
text range: 0..1, str: 'blah'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue