mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1800 Ensure auto-scaling of QWT plots with date scale and week resolution will not miss points in the upper end of the plot
This commit is contained in:
parent
86365357f4
commit
46919b463d
12
ThirdParty/Qwt/src/qwt_date_scale_engine.cpp
vendored
12
ThirdParty/Qwt/src/qwt_date_scale_engine.cpp
vendored
@ -1170,7 +1170,17 @@ QDateTime QwtDateScaleEngine::alignDate(
|
||||
const QDate date = QwtDate::dateOfWeek0(
|
||||
dt.date().year(), d_data->week0Type );
|
||||
|
||||
const int numWeeks = date.daysTo( dt.date() ) / 7;
|
||||
// Manually patched from QWT trunk
|
||||
int numWeeks = date.daysTo( dt.date() ) / 7;
|
||||
if (up)
|
||||
{
|
||||
if (dt.time() > QTime(0, 0) ||
|
||||
date.daysTo(dt.date()) % 7)
|
||||
{
|
||||
numWeeks++;
|
||||
}
|
||||
}
|
||||
|
||||
const int d = qwtAlignValue( numWeeks, stepSize, up ) * 7;
|
||||
|
||||
dt = QwtDate::floor( dt, QwtDate::Day );
|
||||
|
Loading…
Reference in New Issue
Block a user