CP Chart - Reposition model helper when off window

This is already fixed when it is out to the right,
but still can happen to the left.

Fixes #3995
This commit is contained in:
Alejandro Martinez
2021-08-05 13:09:17 -03:00
parent 00b50b47c3
commit b36bbdc3c0

View File

@@ -1365,7 +1365,8 @@ CriticalPowerWindow::event(QEvent *event)
}
// if off the screen move on screen
if (helperWidget()->geometry().x() > geometry().width()) {
if (helperWidget()->geometry().x() > geometry().width() ||
helperWidget()->geometry().x() < geometry().x()) {
helperWidget()->move(mainWidget()->geometry().width()-(275*dpiXFactor), 50*dpiYFactor);
}
}