mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
FIX: 'data plot + keypress g on empty plot' correct fix.
This commit is contained in:
parent
0eaae0cbae
commit
04d4ecddbf
1 changed files with 13 additions and 13 deletions
|
@ -241,7 +241,8 @@ int Plot::xCoordOf(int i, QRect r ) {
|
||||||
|
|
||||||
int Plot::yCoordOf(int v, QRect r, int maxVal) {
|
int Plot::yCoordOf(int v, QRect r, int maxVal) {
|
||||||
int z = (r.bottom() - r.top()) / 2;
|
int z = (r.bottom() - r.top()) / 2;
|
||||||
return -(z * v) / (maxVal + z);
|
if ( maxVal == 0 ) ++maxVal;
|
||||||
|
return -(z * v) / maxVal + z;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Plot::valueOf_yCoord(int y, QRect r, int maxVal) {
|
int Plot::valueOf_yCoord(int y, QRect r, int maxVal) {
|
||||||
|
@ -388,8 +389,7 @@ void Plot::PlotGraph(int *buffer, int len, QRect plotRect, QRect annotationRect,
|
||||||
int n = 0;
|
int n = 0;
|
||||||
int lasty0 = 65535;
|
int lasty0 = 65535;
|
||||||
|
|
||||||
for(v = vMarkers; yCoordOf(v,plotRect,g_absVMax) > plotRect.top() && n < 20; v+= vMarkers ,n++)
|
for (v = vMarkers; yCoordOf(v, plotRect, g_absVMax) > plotRect.top() && n < 20; v+= vMarkers ,n++) {
|
||||||
{
|
|
||||||
int y0 = yCoordOf(v, plotRect, g_absVMax);
|
int y0 = yCoordOf(v, plotRect, g_absVMax);
|
||||||
int y1 = yCoordOf(-v, plotRect, g_absVMax);
|
int y1 = yCoordOf(-v, plotRect, g_absVMax);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue