mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Ground/Joystick/Magicwaypoint: Fix initialization condition that led to crash
when closing gadget and also center icon on click in magic waypoint. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1821 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9f4e3906e3
commit
93a85e24a0
@ -29,6 +29,7 @@ SDLGamepad::SDLGamepad()
|
||||
index = -1;
|
||||
loop = false;
|
||||
tick = MIN_RATE;
|
||||
gamepad = 0;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
@ -85,14 +85,18 @@ void PositionField::updateDesiredIndicator(double north, double east)
|
||||
{
|
||||
QRectF sceneSize = scene()->sceneRect();
|
||||
|
||||
m_positiondesired->setPos((east+1)/2*sceneSize.width(),(-north+1)/2*sceneSize.height());
|
||||
m_positiondesired->setPos(
|
||||
(east+1)/2*sceneSize.width() - m_positiondesired->boundingRect().width() / 2,
|
||||
(-north+1)/2*sceneSize.height() - m_positiondesired->boundingRect().height() / 2);
|
||||
}
|
||||
|
||||
void PositionField::updateActualIndicator(double north, double east)
|
||||
{
|
||||
QRectF sceneSize = scene()->sceneRect();
|
||||
|
||||
m_positionactual->setPos((east+1)/2*sceneSize.width(),(-north+1)/2*sceneSize.height());
|
||||
m_positionactual->setPos(
|
||||
(east+1)/2*sceneSize.width() - m_positionactual->boundingRect().width() / 2,
|
||||
(-north+1)/2*sceneSize.height() - m_positionactual->boundingRect().height() / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user