Skip to content

Commit

Permalink
Merge 659886b into 8e191c7
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Aug 29, 2018
2 parents 8e191c7 + 659886b commit 0d8e3ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions src/plugins/widget/GraphPanelWidget/src/graphpanelplotwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3395,31 +3395,13 @@ void GraphPanelPlotWidget::alignWithNeighbors(bool pCanReplot,
foreach (GraphPanelPlotWidget *plot, selfPlusNeighbors) {
// Determine how much space we should have directly to the left and
// right of the X axis
// Note: normally, we would initialise minBorderDistStartX and
// minBorderDistEndX with a call to
// xScaleWidget->getBorderDistHint(), but for that call to
// work as expected it would have to be preceded by a call to
// xScaleWidget->setMinBorderDist(0, 0). Yet, that call may
// result in one or several graph panels to be refreshed,
// yielding the X axis to be temporarily rendered too far to
// the left. So, to prevent this problem, we initialise
// minBorderDistStartX and minBorderDistEndX with a call to
// xScaleWidget->scaleDraw()->getBorderDistHint() and then
// "manually" check the values of minBorderDistStartX and
// minBorderDistEndX against zero...

QwtScaleWidget *xScaleWidget = plot->axisWidget(QwtPlot::xBottom);
int minBorderDistStartX;
int minBorderDistEndX;

xScaleWidget->scaleDraw()->getBorderDistHint(xScaleWidget->font(), minBorderDistStartX, minBorderDistEndX);

if (minBorderDistStartX < 0)
minBorderDistStartX = 0;

if (minBorderDistEndX < 0)
minBorderDistEndX = 0;

newMinBorderDistStartX = qMax(newMinBorderDistStartX, minBorderDistStartX);
newMinBorderDistEndX = qMax(newMinBorderDistEndX, minBorderDistEndX);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,

void setTitleAxis(int pAxisId, const QString &pTitleAxis);

void alignWithNeighbors(bool pCanReplot, bool pForceAlignment = false);
void alignWithNeighbors(bool pCanReplot, bool pForceAlignment);

signals:
void axesChanged(double pMinX, double pMaxX, double pMinY, double pMaxY);
Expand Down

0 comments on commit 0d8e3ee

Please sign in to comment.