squib 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/RELEASE TODO.md +1 -0
- data/lib/squib/graphics/save_doc.rb +2 -1
- data/lib/squib/version.rb +1 -1
- data/spec/data/samples/custom_config.rb.txt +1 -0
- data/spec/data/samples/saves.rb.txt +2 -0
- data/spec/graphics/graphics_save_doc_spec.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bea6b35bd0a52513549271342876629145edc365
|
4
|
+
data.tar.gz: 83fb26dfa8728b5c0256cb739e52cb50ba3b7635
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f89f00d8bdc62b8fe11f0a91523ba914272ac7ff721f0943ac814160a9fbe42da279463ca218aa11f9a32d126e1b7403c48dc591a357e806638d42849ff09a
|
7
|
+
data.tar.gz: 5db0aa2a77869cf5b0e5518399bfc9640944f969a09a1735a33c99b22f221a8d166aff9c309eea6a4a8fad57a857aa0a6edc4d81b3f940adad66388288f3646a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Squib CHANGELOG
|
2
2
|
|
3
|
+
## v0.5.1
|
4
|
+
* [BUG] Fixed a PDF scaling issue, so now page width and height is properly calculated from DPI (#62)
|
5
|
+
|
6
|
+
Thanks to [Brian Cronin](http://www.boardgamegeek.com/user/MurphyIdiot) for the bug report.
|
7
|
+
|
3
8
|
## v0.5.0
|
4
9
|
* Embedding of SVGs and PNGs into text! See README, `text_options.rb`, and `embed_text.rb`, and API documentation. This was a finnicky feature, so feedback and bug reports are welcome. (#30)
|
5
10
|
* Curves! We can now do Bezier curves. Documented, and added to the sample `draw_shapes.rb` (#37).
|
data/RELEASE TODO.md
CHANGED
@@ -22,7 +22,8 @@ module Squib
|
|
22
22
|
paper_width = p[:width]
|
23
23
|
paper_height = p[:height]
|
24
24
|
file = "#{p[:dir]}/#{p[:file]}"
|
25
|
-
cc = Cairo::Context.new(Cairo::PDFSurface.new(file, paper_width, paper_height))
|
25
|
+
cc = Cairo::Context.new(Cairo::PDFSurface.new(file, paper_width * 72.0 / @dpi, paper_height * 72.0 / @dpi))
|
26
|
+
cc.scale(72.0 / @dpi, 72.0 / @dpi) # for bug #62
|
26
27
|
x, y = p[:margin], p[:margin]
|
27
28
|
card_width = @width - 2 * p[:trim]
|
28
29
|
card_height = @height - 2 * p[:trim]
|
data/lib/squib/version.rb
CHANGED
@@ -35,6 +35,7 @@ cairo: scale([1.0, 1.0])
|
|
35
35
|
cairo: render_rsvg_handle([RSVG::Handle, nil])
|
36
36
|
cairo: restore([])
|
37
37
|
surface: write_to_png(["_output/custom-config_00.png"])
|
38
|
+
cairo: scale([0.24, 0.24])
|
38
39
|
cairo: translate([75, 75])
|
39
40
|
cairo: rectangle([0, 0, 825, 1125])
|
40
41
|
cairo: clip([])
|
@@ -494,6 +494,7 @@ cairo: move_to([0, 0])
|
|
494
494
|
cairo: update_pango_layout([MockDouble])
|
495
495
|
cairo: show_pango_layout([MockDouble])
|
496
496
|
cairo: restore([])
|
497
|
+
cairo: scale([0.24, 0.24])
|
497
498
|
cairo: translate([75, 75])
|
498
499
|
cairo: rectangle([37, 37, 751, 1051])
|
499
500
|
cairo: clip([])
|
@@ -608,6 +609,7 @@ cairo: paint([])
|
|
608
609
|
cairo: reset_clip([])
|
609
610
|
cairo: translate([-2343, -1131])
|
610
611
|
cairo: show_page([])
|
612
|
+
cairo: scale([0.24, 0.24])
|
611
613
|
cairo: translate([75, 75])
|
612
614
|
cairo: rectangle([0, 0, 825, 1125])
|
613
615
|
cairo: clip([])
|
@@ -28,6 +28,7 @@ describe Squib::Deck, '#save_pdf' do
|
|
28
28
|
deck = Squib::Deck.new(cards: 9, width: 825, height: 1125)
|
29
29
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir
|
30
30
|
expect(Squib.logger).to receive(:debug).at_least(:once)
|
31
|
+
expect(cxt).to receive(:scale).with(0.24, 0.24)
|
31
32
|
|
32
33
|
expect_card_place(75, 75)
|
33
34
|
expect_card_place(831, 75)
|
@@ -50,6 +51,7 @@ describe Squib::Deck, '#save_pdf' do
|
|
50
51
|
deck = Squib::Deck.new(cards: num_cards, width: 825, height: 1125)
|
51
52
|
expect(Squib.logger).to receive(:debug).at_least(:once)
|
52
53
|
expect(deck).to receive(:dirify) { |arg| arg } #don't create the dir
|
54
|
+
expect(cxt).to receive(:scale).with(0.24, 0.24)
|
53
55
|
|
54
56
|
expect_card_place(75, 75)
|
55
57
|
expect_card_place(831, 75)
|