mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
Fix demod plot when X starts from negative
This commit is contained in:
parent
25e865afd3
commit
3a74285d7a
1 changed files with 9 additions and 1 deletions
|
@ -443,6 +443,9 @@ void ProxWidget::resizeEvent(QResizeEvent *event) {
|
||||||
//----------- Plotting
|
//----------- Plotting
|
||||||
|
|
||||||
int Plot::xCoordOf(int i, QRect r) {
|
int Plot::xCoordOf(int i, QRect r) {
|
||||||
|
if (i < 0) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
return r.left() + (int)((i - GraphStart) * GraphPixelsPerPoint);
|
return r.left() + (int)((i - GraphStart) * GraphPixelsPerPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +529,12 @@ void Plot::PlotDemod(uint8_t *buffer, size_t len, QRect plotRect, QRect annotati
|
||||||
char str[5];
|
char str[5];
|
||||||
int absVMax = (int)(100 * 1.05 + 1);
|
int absVMax = (int)(100 * 1.05 + 1);
|
||||||
int x = xCoordOf(DemodStart, plotRect);
|
int x = xCoordOf(DemodStart, plotRect);
|
||||||
int y = yCoordOf((buffer[BitStart] * 200 - 100) * -1, plotRect, absVMax);
|
int y = 0;
|
||||||
|
if (DemodStart >= 0) {
|
||||||
|
y = yCoordOf((buffer[BitStart] * 200 - 100) * -1, plotRect, absVMax);
|
||||||
|
} else {
|
||||||
|
y = yCoordOf(0, plotRect, absVMax);
|
||||||
|
}
|
||||||
penPath.moveTo(x, y);
|
penPath.moveTo(x, y);
|
||||||
delta_x = 0;
|
delta_x = 0;
|
||||||
int clk = first_delta_x;
|
int clk = first_delta_x;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue