happo 2.7.5 → 2.7.6
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 +4 -4
- data/lib/happo/public/happo-runner.js +14 -4
- data/lib/happo/version.rb +1 -1
- 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: 6b9353da172d06d10d7aa9c9bc1f1526553e5ec6
|
4
|
+
data.tar.gz: ae91a53e96b445b790973a50e4e36956eb09f4f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
205
|
+
box.left = this.min(box.left, rect.left);
|
196
206
|
box.right = Math.max(box.right, rect.right);
|
197
|
-
box.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:
|
234
|
+
left: undefined,
|
225
235
|
right: 0,
|
226
|
-
top:
|
236
|
+
top: undefined,
|
227
237
|
};
|
228
238
|
|
229
239
|
var rootNodes = this.getRootNodes();
|
data/lib/happo/version.rb
CHANGED