mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13: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:
@ -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(""));
|
||||
|
Reference in New Issue
Block a user