mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-14 15:14:49 -04:00
- ITF14/DPLEIT/DPIDENT: ignore option_2
(check digit options)
- GUI: scalewindow: fix cropping resolution on initial setup (`spnResolution` max 1000 -> 254000) and bound X-dim to <= 10 in `set_maxima()` - GUI: mainwindow: bound X-dim as above and clamp `m_xdimdpVars` members on initial load from INI - GUI: undo `QString::mid()` -> `QString::midRef()` from clazy & explicitly include "QObject" in "qzint.h" (not Qt6 compatible)
This commit is contained in:
parent
7c1bdba8ae
commit
7b41dfbee2
10 changed files with 58 additions and 43 deletions
|
@ -91,19 +91,19 @@ namespace Zint {
|
|||
int comma1 = text.indexOf(',');
|
||||
int comma2 = text.indexOf(',', comma1 + 1);
|
||||
int comma3 = text.indexOf(',', comma2 + 1);
|
||||
int black = 100 - text.midRef(comma3 + 1).toInt();
|
||||
int val = 100 - text.midRef(0, comma1).toInt();
|
||||
int black = 100 - text.mid(comma3 + 1).toInt();
|
||||
int val = 100 - text.mid(0, comma1).toInt();
|
||||
r = (int) roundf((0xFF * val * black) / 10000.0f);
|
||||
val = 100 - text.midRef(comma1 + 1, comma2 - comma1 - 1).toInt();
|
||||
val = 100 - text.mid(comma1 + 1, comma2 - comma1 - 1).toInt();
|
||||
g = (int) roundf((0xFF * val * black) / 10000.0f);
|
||||
val = 100 - text.midRef(comma2 + 1, comma3 - comma2 - 1).toInt();
|
||||
val = 100 - text.mid(comma2 + 1, comma3 - comma2 - 1).toInt();
|
||||
b = (int) roundf((0xFF * val * black) / 10000.0f);
|
||||
a = 0xFF;
|
||||
} else {
|
||||
r = text.midRef(0, 2).toInt(nullptr, 16);
|
||||
g = text.midRef(2, 2).toInt(nullptr, 16);
|
||||
b = text.midRef(4, 2).toInt(nullptr, 16);
|
||||
a = text.length() == 8 ? text.midRef(6, 2).toInt(nullptr, 16) : 0xFF;
|
||||
r = text.mid(0, 2).toInt(nullptr, 16);
|
||||
g = text.mid(2, 2).toInt(nullptr, 16);
|
||||
b = text.mid(4, 2).toInt(nullptr, 16);
|
||||
a = text.length() == 8 ? text.mid(6, 2).toInt(nullptr, 16) : 0xFF;
|
||||
}
|
||||
color.setRgb(r, g, b, a);
|
||||
return color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue