mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
GCS: Control, Tiny fix to center the big red dots :)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1811 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
b868bba1df
commit
b418fe18bf
@ -76,10 +76,13 @@ JoystickControl::~JoystickControl()
|
||||
/**
|
||||
* @brief Update the displayed position based on an MCC update
|
||||
*/
|
||||
void JoystickControl::changePosition(double X, double Y)
|
||||
void JoystickControl::changePosition(double x, double y)
|
||||
{
|
||||
QRectF sceneSize = scene()->sceneRect();
|
||||
m_joystickEnd->setPos((X+1)/2*sceneSize.width(),(-Y+1)/2*sceneSize.height());
|
||||
|
||||
m_joystickEnd->setPos(
|
||||
(x+1) / 2*sceneSize.width() - m_joystickEnd->boundingRect().width() / 2,
|
||||
(-y+1) / 2*sceneSize.height() - m_joystickEnd->boundingRect().height() / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user