mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05: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:
+11
-1
@@ -1170,7 +1170,17 @@ QDateTime QwtDateScaleEngine::alignDate(
|
|||||||
const QDate date = QwtDate::dateOfWeek0(
|
const QDate date = QwtDate::dateOfWeek0(
|
||||||
dt.date().year(), d_data->week0Type );
|
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;
|
const int d = qwtAlignValue( numWeeks, stepSize, up ) * 7;
|
||||||
|
|
||||||
dt = QwtDate::floor( dt, QwtDate::Day );
|
dt = QwtDate::floor( dt, QwtDate::Day );
|
||||||
|
|||||||
Reference in New Issue
Block a user