happo 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b912c9e59c1a784e22ccf182a2cae6e3c33b3d4
4
- data.tar.gz: fdf5aae7d6c23ac0aa719fd10f3c08b166b231b3
3
+ metadata.gz: cc566abbe483b89e474a285181c8b9fecb5c56c8
4
+ data.tar.gz: 4562a7960785de93eed8d66012ff583b8385b665
5
5
  SHA512:
6
- metadata.gz: 727b0821666fa7ee2bf500be9f7a03cb1fa973fa55197ae71df73b8cc22b796abdcec385f0f108d31c76b9642e393474762c4fbe793b4d3a4a47dcffcb10fccb
7
- data.tar.gz: c0b3764ab83e2872ae99ea45daeaac9d17bd24cef8f8fc3e83dc089647fe5598ec5a1913da390393f4e10ef67c82ce7b903ec9e463b8516cb9fcae94f1c27907
6
+ metadata.gz: 6b91a8e431508812db6b92b0f333e98088832a5fe7f2cc6a9f0c33b87cedb865dec0b1eeb2a7fac371e84ac3a700abdbb0bd642778a41a8ae150f397172373ef
7
+ data.tar.gz: 31cf66c036ddb6cd4986588e200f5f8ab8042d1de74106d923817c83d6ea6ed4c3b29bb96ec4dbf58ab6255ea0b481f1bb7d89f0a2349f2e00ec4cc8fe552160
@@ -199,8 +199,16 @@ window.happo = {
199
199
  this.getFullRectRecursive(node.children[i], box);
200
200
  }
201
201
 
202
- // Do width and height calculations at the end, to avoid having to do them
203
- // for every node.
202
+ // As the last step, we calculate the width and height for the box. This is
203
+ // to avoid having to do them for every node. Before we do that however, we
204
+ // cut off things that render off the screen to the top or left, since those
205
+ // won't be in the screenshot file that we then crop from. If you're
206
+ // wondering why right and bottom isn't "fixed" here too, it's because we
207
+ // don't have to since the screenshot already includes overflowing content
208
+ // on the bottom and right.
209
+ box.left = Math.max(box.left, 0);
210
+ box.top = Math.max(box.top, 0);
211
+
204
212
  box.width = box.right - box.left;
205
213
  box.height = box.bottom - box.top;
206
214
 
data/lib/happo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module Happo
3
- VERSION = '2.2.0'
3
+ VERSION = '2.2.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: happo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-16 00:00:00.000000000 Z
12
+ date: 2016-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chunky_png
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.5.1
185
+ rubygems_version: 2.4.5.1
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Happo