Browse Source

Exposing cairo version. Closes #1

v1.x
Tj Holowaychuk 14 years ago
parent
commit
f43ae9252c
  1. 9
      lib/canvas.js
  2. 1
      src/node-canvas.cc

9
lib/canvas.js

@ -12,7 +12,8 @@
var canvas = require('../build/default/canvas') var canvas = require('../build/default/canvas')
, colors = require('./colors') , colors = require('./colors')
, Canvas = canvas.Canvas , Canvas = canvas.Canvas
, Context2d = canvas.Context2d; , Context2d = canvas.Context2d
, cairoVersion = canvas.cairoVersion;
/** /**
* Export `Canvas` as the module. * Export `Canvas` as the module.
@ -26,6 +27,12 @@ var Canvas = exports = module.exports = Canvas;
exports.version = '0.0.1'; exports.version = '0.0.1';
/**
* Cairo version.
*/
exports.cairoVersion = cairoVersion;
/** /**
* Parse the given color `str`. * Parse the given color `str`.
* *

1
src/node-canvas.cc

@ -13,4 +13,5 @@ init (Handle<Object> target) {
HandleScope scope; HandleScope scope;
Canvas::Initialize(target); Canvas::Initialize(target);
Context2d::Initialize(target); Context2d::Initialize(target);
target->Set(String::New("cairoVersion"), String::New(cairo_version_string()));
} }
Loading…
Cancel
Save