fix for PolyPoint/PolyLine requests (incorrect length)

This commit is contained in:
sidorares 2011-07-21 17:19:06 +10:00
parent a1d1bb6e42
commit 1b5eb9145f
2 changed files with 6 additions and 5 deletions

View file

@ -201,6 +201,7 @@ module.exports = {
}
],
// TODO: test
DeleteProperty: [
[ 'CxLLL', [19, 3] ] // wid, propNameAtom
],
@ -254,7 +255,7 @@ module.exports = {
function(coordMode, drawable, gc, points)
{
var format = 'CCSLL';
var args = [64, coordMode, 3+points.length, drawable, gc];
var args = [64, coordMode, 3+points.length/2, drawable, gc];
for (var i=0; i < points.length; ++i)
{
format += 'S';
@ -269,7 +270,7 @@ module.exports = {
function(coordMode, drawable, gc, points)
{
var format = 'CCSLL';
var args = [65, coordMode, 3+points.length, drawable, gc];
var args = [65, coordMode, 3+points.length/2, drawable, gc];
for (var i=0; i < points.length; ++i)
{
format += 'S';

View file

@ -28,10 +28,10 @@ xclient.on('connect', function(display) {
X.on('event', function(ev) {
if (ev.type == 12)
{
X.PolyPoint(0, wid, gc, pts);
//X.PolyPoint(0, wid, gc, pts);
} else if (ev.type == 6) {
pts.push(ev.x);
pts.push(ev.y);
//pts.push(ev.x);
//pts.push(ev.y);
X.PolyPoint(0, wid, gc, [ev.x, ev.y]);
}
});