Add polygon method to dsl

Testing and documentation too.

Closes #67
This commit is contained in:
Andy Meneely
2015-05-22 06:12:48 -04:00
parent f0b71531aa
commit 3bbc787025
8 changed files with 74 additions and 5 deletions
+20 -1
View File
@@ -77,8 +77,27 @@ cairo: line_to([296.90983005625054, 990.4894348370485])
cairo: line_to([307.7254248593737, 976.2235870926212])
cairo: line_to([308.09016994374946, 994.1221474770753])
cairo: line_to([325.0, 1000.0])
cairo: close_path([])
cairo: set_source_color([:cyan])
cairo: set_line_width([1])
cairo: set_line_width([3])
cairo: fill_preserve([])
cairo: set_source_color([:burgundy])
cairo: stroke([])
cairo: restore([])
cairo: save([])
cairo: translate([500, 1000])
cairo: rotate([1.5707963267948966])
cairo: translate([-500, -1000])
cairo: move_to([525, 1000])
cairo: line_to([525.0, 1000.0])
cairo: line_to([507.7254248593737, 1023.7764129073788])
cairo: line_to([479.7745751406263, 1014.6946313073119])
cairo: line_to([479.7745751406263, 985.3053686926881])
cairo: line_to([507.7254248593737, 976.2235870926212])
cairo: line_to([525.0, 1000.0])
cairo: close_path([])
cairo: set_source_color([:cyan])
cairo: set_line_width([2])
cairo: fill_preserve([])
cairo: set_source_color([:burgundy])
cairo: stroke([])
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 30 KiB

+1 -1
View File
@@ -73,7 +73,7 @@ describe "Squib samples" do
log = StringIO.new
mock_cairo(log)
load sample
# overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
test_file_str = File.open(sample_regression_file(sample), 'r:UTF-8').read
expect(log.string).to eq(test_file_str)
end
+1 -1
View File
@@ -104,7 +104,7 @@ def mock_cairo(strio)
set_line_width stroke fill set_source scale render_rsvg_handle circle
triangle line_to operator= show_page clip transform mask rectangle
reset_clip antialias= curve_to matrix= pango_layout_path stroke_preserve
fill_preserve).each do |m|
fill_preserve close_path).each do |m|
allow(cxt).to receive(m) { |*args| strio << scrub_hex("cairo: #{m}(#{args})\n") }
end