happo 2.7.5 → 2.7.6

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: 80c0b6b398d484f5ed1cc3fda76d24c5d038f184
4
- data.tar.gz: adcca757456079200cd1d322acc1269de56c66cc
3
+ metadata.gz: 6b9353da172d06d10d7aa9c9bc1f1526553e5ec6
4
+ data.tar.gz: ae91a53e96b445b790973a50e4e36956eb09f4f4
5
5
  SHA512:
6
- metadata.gz: 392c63412bcc3a919d36735c0fbcde7ede071f096af776046a40b17342761282022e414ad7d61cd4c920ef731222a0e0a68fdec55a170b790d7d38625c020931
7
- data.tar.gz: 2faafe9d4c0144d35a4e460c14a3bd9812495cb61955ce0a5625a252dbe31ec53c6691451cc38d6828548e7f3cea9b2e31c2bebf39645b86f9a7448f6a288c8c
6
+ metadata.gz: 493416b10f5a881202d6ec3e250e96973de130faf26c410354339d10567a12156ef94a87690da60a38e4f3cc91c77159c10de6a30650f629b3f052f9965ab5bd
7
+ data.tar.gz: 57a4cd127019c3b6e4a49b4226b26613b9faa4750601659ad8616852b6b5850da4285fb5144139c2f957a2fae46a17d7f9942753504cef52814e408a6c15e9c4
@@ -182,6 +182,16 @@ window.happo = {
182
182
  }
183
183
  },
184
184
 
185
+ /**
186
+ * Wrapper around Math.min to handle undefined values.
187
+ */
188
+ min: function min(a, b) {
189
+ if (a === undefined) {
190
+ return b;
191
+ }
192
+ return Math.min(a, b);
193
+ },
194
+
185
195
  // This function takes a node and a box object that we will mutate.
186
196
  getFullRectRecursive: function getFullRectRecursive(node, box) {
187
197
  // Since we are already traversing through every node, let's piggyback on
@@ -192,9 +202,9 @@ window.happo = {
192
202
 
193
203
  /* eslint-disable no-param-reassign */
194
204
  box.bottom = Math.max(box.bottom, rect.bottom);
195
- box.left = Math.min(box.left, rect.left);
205
+ box.left = this.min(box.left, rect.left);
196
206
  box.right = Math.max(box.right, rect.right);
197
- box.top = Math.min(box.top, rect.top);
207
+ box.top = this.min(box.top, rect.top);
198
208
  /* eslint-enable no-param-reassign */
199
209
 
200
210
  for (var i = 0; i < node.children.length; i++) {
@@ -221,9 +231,9 @@ window.happo = {
221
231
  // Set up the initial object that we will mutate in our recursive function.
222
232
  var box = {
223
233
  bottom: 0,
224
- left: 0,
234
+ left: undefined,
225
235
  right: 0,
226
- top: 0,
236
+ top: undefined,
227
237
  };
228
238
 
229
239
  var rootNodes = this.getRootNodes();
data/lib/happo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module Happo
3
- VERSION = '2.7.5'
3
+ VERSION = '2.7.6'
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.7.5
4
+ version: 2.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig