psd_native 1.0.0 → 1.0.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: 0267ebc332f459a2246da73dbb83ba072c6689a4
4
- data.tar.gz: de14d32f2fe1a2ea603487364783085c5821266a
3
+ metadata.gz: c97817e8dc5cc4bc5c152271dec5220be1c72733
4
+ data.tar.gz: 33ce557f4e155bcabd6e8b6bc33207799e7094a7
5
5
  SHA512:
6
- metadata.gz: d8934cedf3e9142a63974542b4fce9ab0b1c3c687626bfa735a289e6ecc2cf08b38232177fe59cf159ceea5578c7b51ceed6871be17869473145fcc79a7f0c3f
7
- data.tar.gz: 558be83a9bde428df951a1377294badabf601a4c772bded8402eb75c5d3537619665781d263ad352a30cee5bb0c7ae9a361ed0809b61603547237b5e2e1d102e
6
+ metadata.gz: 8616aa6ff2eba454d41b0ea8311f7e815ddbda88bf9689f06a0ecf95a1d10c6f6acc7435bb2ba505c041108e33845aa5f978c350c4169e920856795f960ff1bb
7
+ data.tar.gz: 8f0ea25002ae6127a6ddc295e0cca45117061d89b82c226d6ed1952563a5a96baedaf97b2d4ca1c2fa3351bc8e251fda7480b5a25597ed6630f96f5633f89f94
@@ -11,7 +11,7 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
11
11
  VALUE canvas = rb_iv_get(self, "@canvas");
12
12
  VALUE canvas_pixels = psd_canvas_to_pixel_array(canvas);
13
13
  VALUE mask = rb_iv_get(self, "@mask");
14
- VALUE *mask_pixels = RARRAY_PTR(psd_canvas_to_pixel_array(mask));
14
+ VALUE mask_pixels = psd_canvas_to_pixel_array(mask);
15
15
 
16
16
  uint32_t canvas_width = FIX2UINT(rb_funcall(canvas, rb_intern("width"), 0));
17
17
  uint32_t canvas_height = FIX2UINT(rb_funcall(canvas, rb_intern("height"), 0));
@@ -26,6 +26,7 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
26
26
 
27
27
  int x, y, doc_x, doc_y, mask_x, mask_y;
28
28
  uint32_t alpha, color, loc;
29
+ VALUE pixel;
29
30
  for (y = 0; y < canvas_height; y++) {
30
31
  for (x = 0; x < canvas_width; x++) {
31
32
  doc_x = canvas_left + x;
@@ -42,7 +43,8 @@ VALUE psd_native_clipping_mask_apply_bang(VALUE self) {
42
43
  if (loc > mask_pixel_length) {
43
44
  alpha = 0;
44
45
  } else {
45
- alpha = A(FIX2UINT(mask_pixels[loc]));
46
+ pixel = rb_ary_entry(mask_pixels, loc);
47
+ alpha = pixel == Qnil ? 0 : A(FIX2UINT(pixel));
46
48
  }
47
49
  }
48
50
 
@@ -1,3 +1,3 @@
1
1
  module PSDNative
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psd_native
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-03 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: psd