1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +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:
cranphin 2010-09-30 20:14:39 +00:00 committed by cranphin
parent b868bba1df
commit b418fe18bf

View File

@ -76,10 +76,13 @@ JoystickControl::~JoystickControl()
/** /**
* @brief Update the displayed position based on an MCC update * @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(); 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);
} }
/** /**