Skip to content
Snippets Groups Projects
Commit 71ab10cd authored by André Offringa's avatar André Offringa
Browse files

Merge branch 'fix-plot-crash' into 'master'

Avoid crash when plot area hasn't been initialized yet

See merge request aroffringa/aoflagger!127
parents e3fefce1 db4ba770
No related branches found
No related tags found
No related merge requests found
......@@ -507,17 +507,19 @@ void HeatMap::postRender(const Cairo::RefPtr<Cairo::Context>& cairo,
const Rectangle pArea = getPlotArea(width, height);
const double xAxisSize = _xAxisMax - _xAxisMin;
const double yAxisSize = _yAxisMax - _yAxisMin;
cairo->save();
cairo->transform(Cairo::Matrix(pArea.width / xAxisSize, 0.0, 0.0,
-pArea.height / yAxisSize,
pArea.x - _xAxisMin * pArea.width / xAxisSize,
height - (height - pArea.height - pArea.y) +
_yAxisMin * pArea.height / yAxisSize));
// cairo->rectangle(0.0, 0.0, xAxisSize, yAxisSize);
// cairo->clip();
_signalDraw(cairo);
cairo->restore();
if (xAxisSize != 0.0 && yAxisSize != 0.0) {
cairo->save();
cairo->transform(Cairo::Matrix(
pArea.width / xAxisSize, 0.0, 0.0, -pArea.height / yAxisSize,
pArea.x - _xAxisMin * pArea.width / xAxisSize,
height - (height - pArea.height - pArea.y) +
_yAxisMin * pArea.height / yAxisSize));
// cairo->rectangle(0.0, 0.0, xAxisSize, yAxisSize);
// cairo->clip();
_signalDraw(cairo);
cairo->restore();
}
}
void HeatMap::findMinMax(const ImageInterface& image, float& min, float& max) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment