mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
removed potentially dangerous dangling pointer
This commit is contained in:
parent
3c5f55b77f
commit
241a587d9f
@ -37,6 +37,7 @@
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QSlider>
|
||||
#include <vcg/space/color4.h>
|
||||
#include "rfx_dialog.h"
|
||||
|
||||
class RfxColorBox : public QWidget
|
||||
@ -51,15 +52,9 @@ public:
|
||||
Returns the current color as an array of float value between 0 and 1.
|
||||
@return the current color as float array.
|
||||
*/
|
||||
float* getColorf(){
|
||||
float r, g, b, a;
|
||||
r = this->_redS->value() / 255.0f;
|
||||
g = this->_greenS->value() / 255.0f;
|
||||
b = this->_blueS->value() / 255.0f;
|
||||
a = this->_alphaS->value() / 255.0f;
|
||||
|
||||
float vals[4] = {r, g, b, a};
|
||||
return vals;
|
||||
inline vcg::Color4f getColorf(){
|
||||
vcg::Color4f c(_redS->value() / 255.0f,_greenS->value() / 255.0f,_blueS->value() / 255.0f,_alphaS->value() / 255.0f);
|
||||
return c;
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
||||
@ -552,11 +552,11 @@ void RfxDialog::ChangeValue(const QString& val)
|
||||
} else {
|
||||
RfxColorBox *cBox = dynamic_cast<RfxColorBox*>(sender);
|
||||
if (cBox != NULL) {
|
||||
float* newVal = cBox->getColorf();
|
||||
oldVal[0] = newVal[0];
|
||||
oldVal[1] = newVal[1];
|
||||
oldVal[2] = newVal[2];
|
||||
oldVal[3] = newVal[3];
|
||||
vcg::Color4f newVal = cBox->getColorf();
|
||||
oldVal[0] = newVal.X();
|
||||
oldVal[1] = newVal.Y();
|
||||
oldVal[2] = newVal.Z();
|
||||
oldVal[3] = newVal.W();
|
||||
uni->PassToShader();
|
||||
mGLWin->updateGL();
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user