mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Fix some physmin/max yaxis scaling issues
This commit is contained in:
parent
193dead833
commit
fd09eb4307
@ -838,7 +838,7 @@ void gToolTip::paint() //actually paints it.
|
||||
lines_drawn_this_frame+=4;
|
||||
quads_drawn_this_frame+=1;
|
||||
|
||||
QBrush brush(QColor(255,255,128,255));
|
||||
QBrush brush(QColor(255,255,128,200));
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
painter.setBrush(brush);
|
||||
painter.setPen(QColor(0,0,0,255));
|
||||
|
@ -160,12 +160,11 @@ void gLineChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
}*/
|
||||
|
||||
if (w.zoomY()==0) {
|
||||
miny=m_physminy;
|
||||
maxy=m_physmaxy;
|
||||
miny=m_physminy, maxy=m_physmaxy;
|
||||
} else {
|
||||
miny=w.min_y, maxy=w.max_y;
|
||||
w.roundY(miny,maxy);
|
||||
}
|
||||
w.roundY(miny,maxy);
|
||||
|
||||
double xx=maxx-minx;
|
||||
double xmult=double(width)/xx;
|
||||
@ -698,12 +697,17 @@ void AHIChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
|
||||
EventDataType miny,maxy;
|
||||
double minx,maxx;
|
||||
miny=w.min_y, maxy=w.max_y;
|
||||
|
||||
maxx=w.max_x, minx=w.min_x;
|
||||
|
||||
// hmmm.. subtract_offset..
|
||||
|
||||
if (w.zoomY()==0) {
|
||||
miny=w.physMinY();
|
||||
maxy=w.physMaxY();
|
||||
} else {
|
||||
miny=w.min_y, maxy=w.max_y;
|
||||
}
|
||||
w.roundY(miny,maxy);
|
||||
|
||||
double xx=maxx-minx;
|
||||
|
@ -48,6 +48,8 @@ void SummaryChart::SetDay(Day * nullday)
|
||||
m_goodcodes.clear();
|
||||
m_miny=999999999;
|
||||
m_maxy=-999999999;
|
||||
m_physmaxy=0;
|
||||
m_physminy=0;
|
||||
m_minx=0;
|
||||
m_maxx=0;
|
||||
|
||||
@ -107,6 +109,7 @@ void SummaryChart::SetDay(Day * nullday)
|
||||
}
|
||||
int suboffset;
|
||||
SummaryType type;
|
||||
bool first=true;
|
||||
|
||||
for (QMap<QDate,QList<Day *> >::iterator d=PROFILE.daylist.begin();d!=PROFILE.daylist.end();d++) {
|
||||
tt=QDateTime(d.key(),QTime(0,0,0),Qt::UTC).toTime_t();
|
||||
@ -144,10 +147,16 @@ void SummaryChart::SetDay(Day * nullday)
|
||||
|
||||
m_times[dn][s]=tmp2;
|
||||
|
||||
if (tmp2 < m_miny)
|
||||
if (first) {
|
||||
m_miny=tmp2;
|
||||
if (tmp2+tmp > m_maxy)
|
||||
m_maxy=tmp2+tmp;
|
||||
first=false;
|
||||
} else {
|
||||
if (tmp2 < m_miny)
|
||||
m_miny=tmp2;
|
||||
if (tmp2+tmp > m_maxy)
|
||||
m_maxy=tmp2+tmp;
|
||||
}
|
||||
}
|
||||
if (total>0) {
|
||||
m_days[dn]=day;
|
||||
@ -248,7 +257,8 @@ void SummaryChart::SetDay(Day * nullday)
|
||||
}
|
||||
// m_minx=qint64(QDateTime(PROFILE.FirstDay(),QTime(0,0,0),Qt::UTC).toTime_t())*1000L;
|
||||
m_maxx=qint64(QDateTime(PROFILE.LastDay(),QTime(23,59,0),Qt::UTC).toTime_t())*1000L;
|
||||
|
||||
m_physmaxy=m_maxy;
|
||||
m_physminy=m_miny;
|
||||
}
|
||||
|
||||
QColor brighten(QColor color)
|
||||
@ -290,9 +300,19 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
qint64 xx=maxx - minx;
|
||||
float days=double(xx)/86400000.0;
|
||||
|
||||
EventDataType maxy=m_maxy;
|
||||
EventDataType miny=m_miny;
|
||||
w.roundY(miny,maxy);
|
||||
|
||||
EventDataType maxy;
|
||||
EventDataType miny;
|
||||
|
||||
if (w.zoomY()==0) {
|
||||
maxy=m_physmaxy;
|
||||
miny=m_physminy;
|
||||
w.roundY(miny,maxy);
|
||||
} else {
|
||||
maxy=m_maxy;
|
||||
miny=m_miny;
|
||||
w.roundY(miny,maxy);
|
||||
}
|
||||
|
||||
EventDataType yy=maxy-miny;
|
||||
EventDataType ymult=float(height-2)/yy;
|
||||
|
@ -29,11 +29,18 @@ void gXGrid::paint(gGraph & w,int left,int top, int width, int height)
|
||||
|
||||
gVertexBuffer * stippled, * lines;
|
||||
|
||||
EventDataType miny=w.min_y;
|
||||
EventDataType maxy=w.max_y;
|
||||
EventDataType miny,maxy;
|
||||
|
||||
if (miny<0) { // even it up if it's starts negative
|
||||
miny=-MAX(fabs(miny),fabs(maxy));
|
||||
if (w.zoomY()==0) {
|
||||
miny=w.physMinY();
|
||||
maxy=w.physMaxY();
|
||||
} else {
|
||||
miny=w.min_y;
|
||||
maxy=w.max_y;
|
||||
|
||||
if (miny<0) { // even it up if it's starts negative
|
||||
miny=-MAX(fabs(miny),fabs(maxy));
|
||||
}
|
||||
}
|
||||
|
||||
w.roundY(miny,maxy);
|
||||
@ -277,9 +284,8 @@ void gYAxis::paint(gGraph & w,int left,int top, int width, int height)
|
||||
if (miny<0) { // even it up if it's starts negative
|
||||
miny=-MAX(fabs(miny),fabs(maxy));
|
||||
}
|
||||
|
||||
w.roundY(miny,maxy);
|
||||
}
|
||||
w.roundY(miny,maxy);
|
||||
|
||||
EventDataType dy=maxy-miny;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user