Skip to content

Commit

Permalink
Test fix for node 0.8 failing.
Browse files Browse the repository at this point in the history
This was suggested by someone. Just checking it out.
  • Loading branch information
Deltatiger committed Apr 16, 2016
1 parent a027809 commit eb18a1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/robotjs.cc
Expand Up @@ -734,17 +734,17 @@ class BMP
//Convert object from Javascript to a C++ class (BMP).
BMP buildBMP(Local<Object> info)
{
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();

char * buf = NULL;
BMP img;
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();

img.width = obj->Get(Nan::New("width").ToLocalChecked())->Uint32Value();
img.height = obj->Get(Nan::New("height").ToLocalChecked())->Uint32Value();
img.byteWidth = obj->Get(Nan::New("byteWidth").ToLocalChecked())->Uint32Value();
img.bitsPerPixel = obj->Get(Nan::New("bitsPerPixel").ToLocalChecked())->Uint32Value();
img.bytesPerPixel = obj->Get(Nan::New("bytesPerPixel").ToLocalChecked())->Uint32Value();

char* buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));
buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));

//Convert the buffer to a uint8_t which createMMBitmap requires.
img.image = (uint8_t *)malloc(img.byteWidth * img.height);
Expand Down

0 comments on commit eb18a1f

Please sign in to comment.