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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c5c85ffb9c9c92b81c4f2ad180fd3965ab5c494
4
- data.tar.gz: 81462e7d7476b0e874d4fe2bb6eba4928e08876c
3
+ metadata.gz: bea6b35bd0a52513549271342876629145edc365
4
+ data.tar.gz: 83fb26dfa8728b5c0256cb739e52cb50ba3b7635
5
5
  SHA512:
6
- metadata.gz: 43b399f4f92899eef5694dca52405126a8de832f79d7cb1703d365fe3671bd54fbab54a9e801ffa509fa358b7c74de23d94b8125e2b02809eacf1315fc12aaf9
7
- data.tar.gz: c334016446d1784927b72d538391d72ec963fdca231aa101151f6dfa25a8c7b88b96b70272f6d79b6c9ccfbc300eade29b66aa7b1adac06a8f45e05c47787fa5
6
+ metadata.gz: 07f89f00d8bdc62b8fe11f0a91523ba914272ac7ff721f0943ac814160a9fbe42da279463ca218aa11f9a32d126e1b7403c48dc591a357e806638d42849ff09a
7
+ data.tar.gz: 5db0aa2a77869cf5b0e5518399bfc9640944f969a09a1735a33c99b22f221a8d166aff9c309eea6a4a8fad57a857aa0a6edc4d81b3f940adad66388288f3646a
@@ -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).
@@ -14,3 +14,4 @@ Be sure to remember to do the following for releases. (Copy into a GitHub issue)
14
14
  - [ ] Github milestone closed
15
15
  - [ ] Push `rake doc` to website
16
16
  - [ ] Bump version.rb to the next alpha
17
+ - [ ] Publish on BoardGameGeek thread
@@ -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]
@@ -6,5 +6,5 @@ module Squib
6
6
  # Most of the time this is in the alpha of the next release.
7
7
  # e.g. v0.0.5a is on its way to becoming v0.0.5
8
8
  #
9
- VERSION = '0.5.0'
9
+ VERSION = '0.5.1'
10
10
  end
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Meneely