fix: add length to AddGlyph

This commit is contained in:
Andrey Sidorov 2014-03-26 11:20:34 +11:00
parent 79cf131815
commit 54bd06c136

View file

@ -1,4 +1,4 @@
// this will be eventually moved to lib/node-x11/extensions
var x11 = require('..');
@ -375,7 +375,8 @@ exports.requireExt = function(display, callback)
var paddedLength = xutil.padded_length(imageBytes);
var len = numGlyphs * 4 + paddedLength / 4 + 3;
// TODO: check length, use bigReq
X.pack_stream.pack('CCSL', [ext.majorOpcode, 20, len, gsid]);
X.pack_stream.pack('CCSLL', [ext.majorOpcode, 20, len, gsid, glyps.length]);
for (i = 0; i < numGlyphs; i++)
X.pack_stream.pack('L', glyph[i].id);
for (i = 0; i < numGlyphs; i++)
@ -388,6 +389,18 @@ exports.requireExt = function(display, callback)
}
//AddGlyphsFromPicture, opcode=21 (not in spec)
// FreeGlyps - 22
ext.CompositeGlyphs8 = function(op, src, dst, pictformat, gsid, srcX, srcY, dstX, dstY, glyphs)
{
X.seq_num++;
X.pack_stream.pack(
'CCSCxxxLLLssssssSS',
[ext.majorOpcode, 8, 9, op, src, mask, dst, srcX, srcY, maskX, maskY, dstX, dstY, width, height]
)
.flush();
}
// TODO: implement xutil-like code https://github.com/alexer/python-xlib-render/blob/master/xutil.py