I have modified div drawing method by joining side by side divs to one div.

pull/8/head
MarkoNiitsoo 12 years ago
parent 81c8a12397
commit 0ba907cd23

@ -352,7 +352,7 @@
position: 'absolute', position: 'absolute',
padding: 0, padding: 0,
margin: 0, margin: 0,
width: moduleSize, // width: moduleSize,
height: moduleSize, height: moduleSize,
'background-color': settings.fill 'background-color': settings.fill
}, },
@ -364,16 +364,25 @@
} }
for (row = 0; row < moduleCount; row += 1) { for (row = 0; row < moduleCount; row += 1) {
for (col = 0; col < moduleCount; col += 1) { var left=0;
for (col = 0; col < moduleCount+1; col += 1) {
if (qr.isDark(row, col)) { if (qr.isDark(row, col)) {
$('<div/>') //lets remember the left point on dark area
.css(darkCSS) if(!left)left=offset + col * moduleSize;
.css({ }else{
left: offset + col * moduleSize, //and when it's not dark area then we draw the dark div
top: offset + row * moduleSize if(left){
}) $('<div/>')
.appendTo($div); .css(darkCSS)
} .css({
left: left,
width: offset + col * moduleSize - left,
top: offset + row * moduleSize
})
.appendTo($div);
left=0;
}
}
} }
} }

Loading…
Cancel
Save