psd 2.1.1 → 2.1.2

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: b59b96e20719a364948a8b25311fbe7ce9dfa6ba
4
- data.tar.gz: fae553661c48a2caaee9212dd14e33589dd4c865
3
+ metadata.gz: 62a564e222daa1c918ef3bdf9c2a4f99dfd59833
4
+ data.tar.gz: 93c28d4cba1c961cb28734da81f54e1617adcbdd
5
5
  SHA512:
6
- metadata.gz: a8629e8bca3c0e42bef10e2ab7b645c27b05a7e985fab315c3eadf878e6818b57fa32705ed679431cb60ebae2b558a08498ee1e134413830f0cf80add147ec67
7
- data.tar.gz: c8e49f5511f1e9cfba8169e45853cd2c4e7c6b22da8e659d0573cfabbe745d85422e12a0bbef73092b3595d85a4f9078bf3a54d96dde53c99ad339ed56a328f6
6
+ metadata.gz: 5eb251154704e8172420d3aa1d97851f739f516dcda1d659349719933f354e7443e3a4cebad498084ccf475505e5f97fef0a16f5cf15b25c4bdc3264401b9c59
7
+ data.tar.gz: 7b4c1554a65b7f491f197839b2a99fe383e97c6b1f79ee0528374c919e11abbf3d26293c1b27fc11ca11098b64594651d820d4e9a88e192a4ef4182f0d922106
@@ -26,10 +26,11 @@ class PSD
26
26
  layer_x = doc_x - @layer.left
27
27
  layer_y = doc_y - @layer.top
28
28
 
29
+ next unless @canvas.canvas.include_xy?(layer_x, layer_y)
29
30
  color = ChunkyPNG::Color.to_truecolor_alpha_bytes(@canvas[layer_x, layer_y])
30
31
 
31
32
  # We're off the document canvas. Crop.
32
- if doc_x < 0 || doc_x >= @doc_width || doc_y < 0 || doc_y > @doc_height
33
+ if doc_x < 0 || doc_x > @doc_width || doc_y < 0 || doc_y > @doc_height
33
34
  color[3] = 0
34
35
  else
35
36
  color[3] = color[3] * @mask_data[i] / 255
data/lib/psd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class PSD
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre