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,15 +364,24 @@
} }
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)) {
//lets remember the left point on dark area
if(!left)left=offset + col * moduleSize;
}else{
//and when it's not dark area then we draw the dark div
if(left){
$('<div/>') $('<div/>')
.css(darkCSS) .css(darkCSS)
.css({ .css({
left: offset + col * moduleSize, left: left,
width: offset + col * moduleSize - left,
top: offset + row * moduleSize top: offset + row * moduleSize
}) })
.appendTo($div); .appendTo($div);
left=0;
}
} }
} }
} }

Loading…
Cancel
Save