From 71aa601bd6b005d62b4e92a22d2e00481dbb9edd Mon Sep 17 00:00:00 2001 From: pixhawk Date: Wed, 21 Dec 2011 14:32:53 +0100 Subject: [PATCH] Fixed resize bug in HUD. --- src/ui/HUD.cc | 1 + src/ui/QGCRGBDView.cc | 2 +- src/ui/map3D/Pixhawk3DWidget.cc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 42bca86d5..1ee2aae30 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -153,6 +153,7 @@ HUD::HUD(int width, int height, QWidget* parent) connect(refreshTimer, SIGNAL(timeout()), this, SLOT(paintHUD())); // Resize to correct size and fill with image + resize(this->width(), this->height()); //glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits()); // Set size once diff --git a/src/ui/QGCRGBDView.cc b/src/ui/QGCRGBDView.cc index 4813b3d0c..de45d8065 100644 --- a/src/ui/QGCRGBDView.cc +++ b/src/ui/QGCRGBDView.cc @@ -248,7 +248,7 @@ void QGCRGBDView::updateData(UASInterface *uas) { if (depth[c] != 0) { - int idx = fminf(depth[c], 10.0f) / 10.0f * 127.0f; + int idx = fminf(depth[c], 7.0f) / 7.0f * 127.0f; idx = 127 - idx; pixel[0] = colormapJet[idx][2] * 255.0f; diff --git a/src/ui/map3D/Pixhawk3DWidget.cc b/src/ui/map3D/Pixhawk3DWidget.cc index a13dcc1e6..5429c7cb4 100644 --- a/src/ui/map3D/Pixhawk3DWidget.cc +++ b/src/ui/map3D/Pixhawk3DWidget.cc @@ -1238,7 +1238,7 @@ Pixhawk3DWidget::updateRGBD(double robotX, double robotY, double robotZ) { if (depth[c] != 0) { - int idx = fminf(depth[c], 10.0f) / 10.0f * 127.0f; + int idx = fminf(depth[c], 7.0f) / 7.0f * 127.0f; idx = 127 - idx; pixel[0] = colormap_jet[idx][2] * 255.0f; -- 2.22.0