Browse Source

Fixed inspect

v1.x
Tj Holowaychuk 14 years ago
parent
commit
d3c0d43ddf
  1. 4
      lib/pixelarray.js
  2. 1
      src/PixelArray.cc

4
lib/pixelarray.js

@ -20,10 +20,10 @@ PixelArray.prototype.inspect = function(){
var buf = '[PixelArray ';
for (var i = 0, len = this.length; i < len; i += 4) {
buf += '\n ' + i + ': rgba('
+ this[i + 0] + ','
+ this[i + 1] + ','
+ this[i + 2] + ','
+ this[i + 3] + ','
+ this[i] + ')';
+ this[i + 3] + ')';
}
return buf + '\n]';
};

1
src/PixelArray.cc

@ -82,6 +82,7 @@ PixelArray::PixelArray(Canvas *canvas, int src_x, int src_y, int width, int heig
_width(width), _height(height) {
_data = (uint8_t *) malloc(length());
memset(_data, 0, length());
_data = cairo_image_surface_get_data(canvas->surface());
}
PixelArray::PixelArray(int width, int height):

Loading…
Cancel
Save