likadan 0.0.4 → 0.0.5

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: 957b1cda6eb70bcb989807e528334c7d41058326
4
- data.tar.gz: 28610f653c625a8437d057d7cff5cc8f2a90b014
3
+ metadata.gz: df8ec3d54bd3fc9f9fa37fac5efbd69c26b4b223
4
+ data.tar.gz: aa754753cfc9fef241c026f7142a00598f540964
5
5
  SHA512:
6
- metadata.gz: bce71e0320443c5ce1a036a4f0033a641201decb0d7e2b44bfd6dae70df88d550c586fe0074c259f1973f759c769a81c2c019f2868143d5c2fd9fbc1ad7ea910
7
- data.tar.gz: 7515a142377ed7ec6c23e521ab54403d4a3755d7dda20e85dbd700493d553529c8c1dee44e0093421594654128a07b1a0c3bce1f8e9813285a6a89e5589f87c8
6
+ metadata.gz: dd7be6c3cd2b2d443949464a27f69b9b3347b5b47b33c32eb6cf7c5179412fb1ad7051d42f86d0335600faec8bd2b38ac61ecbcd2a5a2feb13c4e3d90949e880
7
+ data.tar.gz: 0df70f6aa8be4e7b81ecf65c7e74e12923403cc983f58f8a3d6cc217c7890151bc44b27f77fad15290822dcdda7e35e32a4864a410a80cd8d4856bf2fcc0598f
@@ -38,7 +38,10 @@ begin
38
38
  # Save and crop the screenshot
39
39
  driver.save_screenshot(output_file)
40
40
  cropped = ChunkyPNG::Image.from_file(output_file)
41
- cropped.crop!(0, 0, rendered['width'], rendered['height'])
41
+ cropped.crop!(rendered['left'],
42
+ rendered['top'],
43
+ rendered['width'],
44
+ rendered['height'])
42
45
  cropped.save(output_file)
43
46
 
44
47
  print "Checking \"#{current['name']}\" at #{width}px... "
@@ -66,15 +66,21 @@ window.likadan = {
66
66
 
67
67
  var width = elem.offsetWidth;
68
68
  var height = elem.offsetHeight;
69
+ var top = elem.offsetTop;
70
+ var left = elem.offsetLeft;
69
71
 
70
72
  if (this.currentExample.options.snapshotEntireScreen) {
71
73
  width = window.innerWidth;
72
74
  height = window.innerHeight;
75
+ top = 0;
76
+ left = 0;
73
77
  }
74
78
  return {
75
79
  name: this.currentExample.name,
76
80
  width: width,
77
81
  height: height,
82
+ top: top,
83
+ left: left
78
84
  };
79
85
  } catch (error) {
80
86
  console.error(error);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: likadan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig