mirror of
https://github.com/Merricx/qrazybox.git
synced 2025-04-19 17:49:04 +02:00
fix styling
This commit is contained in:
parent
419f7cb342
commit
42cfcdcb49
1 changed files with 19 additions and 27 deletions
46
js/qr.js
46
js/qr.js
|
@ -208,32 +208,26 @@ var version_information_table_bit = [
|
||||||
];
|
];
|
||||||
|
|
||||||
function add_version_info(t, version){
|
function add_version_info(t, version){
|
||||||
|
if (version >= 7) {
|
||||||
if (version >= 7) {
|
for (step=0 ; step < 3 ; step++ ){
|
||||||
for (step=0 ; step < 3 ; step++ )
|
x=0;
|
||||||
{
|
for(let i = 17 - step; i>=0 ; i -= 3){
|
||||||
x=0;
|
// Bottom Left
|
||||||
for(let i = 17 - step; i>=0 ; i -= 3){
|
draw_square(t, 4*version + 6 + step, x ,1, version_information_table_bit[version - 7][i]);
|
||||||
// Bottom Left
|
// Top Right
|
||||||
draw_square(t, 4*version + 6 + step, x ,1, version_information_table_bit[version - 7][i]);
|
draw_square(t, x, 4*version + 6 + step ,1, version_information_table_bit[version - 7][i]);
|
||||||
// Top Right
|
x++;
|
||||||
draw_square(t, x, 4*version + 6 + step ,1, version_information_table_bit[version - 7][i]);
|
}
|
||||||
|
}
|
||||||
x++;
|
}
|
||||||
|
return t;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.thonky.com/qr-code-tutorial/format-version-information
|
// https://www.thonky.com/qr-code-tutorial/format-version-information
|
||||||
function add_dark_module(t, version){
|
function add_dark_module(t, version){
|
||||||
|
//dark module is always (8, 4*version + 9)
|
||||||
//dark module is always (8, 4*version + 9)
|
draw_square(t, 4*version + 9, 8 ,1, BLACK_COLOR);
|
||||||
draw_square(t, 4*version + 9, 8 ,1, BLACK_COLOR);
|
return t;
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -262,10 +256,8 @@ function generate_qr(version){
|
||||||
generate_timing_pattern_h(t, 8, 6, x_max-9);
|
generate_timing_pattern_h(t, 8, 6, x_max-9);
|
||||||
|
|
||||||
add_alignment_patterns(t, version-1);
|
add_alignment_patterns(t, version-1);
|
||||||
|
add_dark_module(t,version);
|
||||||
|
add_version_info(t,version);
|
||||||
|
|
||||||
|
return t;
|
||||||
add_dark_module(t,version);
|
|
||||||
add_version_info(t,version);
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue