mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-15 07:34:35 -04:00
aztec: GUI: fix layers calc from width;
add overrun check of `adjusted_string` before padding in user-specified size case but probably can't happen; various fiddlings with code to make a bit more concise
This commit is contained in:
parent
86748999a4
commit
0601b580b2
3 changed files with 127 additions and 296 deletions
|
@ -3584,7 +3584,13 @@ void MainWindow::automatic_info_set()
|
|||
if (w <= 27) { // Note Zint always favours Compact on automatic
|
||||
txt->setText(QString::asprintf("(%d X %d Compact)", w, w));
|
||||
} else {
|
||||
txt->setText(QString::asprintf("(%d X %d (%d Layers))", w, w, (w - 15) / 4));
|
||||
int layers;
|
||||
if (w <= 95) {
|
||||
layers = (w - 16 + (w <= 61)) / 4;
|
||||
} else {
|
||||
layers = (w - 20 + (w <= 125) * 2) / 4;
|
||||
}
|
||||
txt->setText(QString::asprintf("(%d X %d (%d Layers))", w, w, layers));
|
||||
}
|
||||
} else {
|
||||
txt->setText(QSL(""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue