- double middle = curve->GetEndY() - range/2;
- curve->SetStartY( middle - new_range / 2 );
- curve->SetEndY( middle + new_range / 2 );
+ double new_offset = offset / factor;
+
+ if (m_enlargeAroundWindowCentre)
+ {
+ double middle = curve->GetStartY() - offset + range/2;
+
+ curve->SetStartY( middle - new_range / 2 + new_offset );
+ curve->SetEndY( middle + new_range / 2 + new_offset );
+ }
+ else
+ {
+ curve->SetStartY( (curve->GetStartY() - offset)/factor + new_offset );
+ curve->SetEndY( (curve->GetEndY() - offset)/factor + new_offset );
+ }