Node.js patches

This commit is contained in:
Joshua Granick
2015-03-17 22:41:17 -07:00
parent 52084b75dc
commit a44a109cda
3 changed files with 12 additions and 4 deletions

View File

@@ -214,7 +214,7 @@ class System {
#elseif nodejs
if (__nodeNDLLModule == null) {
__nodeNDLLModule = untyped require('bindings')('node_ndll');
__nodeNDLLModule = untyped require('ndll');
}
#end

View File

@@ -128,7 +128,7 @@ class Font {
lime_font_set_size (src, fontSize);
var bytes = new ByteArray ();
bytes.bigEndian = false;
bytes.endian = "littleEndian";
if (lime_font_render_glyph (src, glyph, bytes)) {
@@ -143,7 +143,11 @@ class Font {
var data = new ByteArray (width * height);
bytes.readBytes (data, 0, width * height);
#if js
var buffer = new ImageBuffer (data.byteView, width, height, 1);
#else
var buffer = new ImageBuffer (new UInt8Array (data), width, height, 1);
#end
var image = new Image (buffer, 0, 0, width, height);
image.x = x;
image.y = y;
@@ -182,7 +186,7 @@ class Font {
lime_font_set_size (src, fontSize);
var bytes = new ByteArray ();
bytes.bigEndian = false;
bytes.endian = "littleEndian";
if (lime_font_render_glyphs (src, glyphList, bytes)) {
@@ -307,7 +311,11 @@ class Font {
}
#if js
buffer.data = data.byteView;
#else
buffer.data = new UInt8Array (data);
#end
return map;

View File

@@ -56,7 +56,7 @@ class TextLayout {
if (__buffer == null) {
__buffer = new ByteArray ();
__buffer.bigEndian = false;
__buffer.endian = "littleEndian";
}