mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Bugfix: step curvetype; Tweek: adjust node value position and color.
This commit is contained in:
parent
13cd6c56f7
commit
a328ab9973
@ -147,7 +147,9 @@ void MixerCurve::UpdateCurveUI()
|
||||
m_mixerUI->CurveMax->setVisible(true);
|
||||
m_mixerUI->stepLabel->setText("Step at");
|
||||
m_mixerUI->stepLabel->setVisible(true);
|
||||
m_mixerUI->CurveStep->setVisible(true);
|
||||
m_mixerUI->CurveStep->setVisible(true);
|
||||
|
||||
m_mixerUI->CurveStep->setMinimum(1.0);
|
||||
m_mixerUI->CurveStep->setMaximum(4.0);
|
||||
}
|
||||
if ( curveType.compare("Exp")==0)
|
||||
@ -202,7 +204,7 @@ void MixerCurve::GenerateCurve()
|
||||
}
|
||||
if ( CurveType.compare("Step")==0)
|
||||
{
|
||||
if (scale*100<value3)
|
||||
if (i < value3) //(scale*100<value3)
|
||||
{
|
||||
points.append(value1);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ void Edge::adjust()
|
||||
prepareGeometryChange();
|
||||
|
||||
if (length > qreal(20.)) {
|
||||
QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length);
|
||||
QPointF edgeOffset((line.dx() * 13) / length, (line.dy() * 13) / length);
|
||||
sourcePoint = line.p1() + edgeOffset;
|
||||
destPoint = line.p2() - edgeOffset;
|
||||
} else {
|
||||
|
@ -59,13 +59,13 @@ QList<Edge *> Node::edges() const
|
||||
|
||||
QRectF Node::boundingRect() const
|
||||
{
|
||||
return QRectF(-12, -12, 25, 25);
|
||||
return QRectF(-13, -13, 26, 26);
|
||||
}
|
||||
|
||||
QPainterPath Node::shape() const
|
||||
{
|
||||
QPainterPath path;
|
||||
path.addEllipse(-12, -12, 25, 25);
|
||||
path.addEllipse(-13, -13, 26, 26);
|
||||
return path;
|
||||
}
|
||||
|
||||
@ -89,10 +89,16 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
||||
}
|
||||
painter->setBrush(gradient);
|
||||
painter->setPen(QPen(Qt::black, 0));
|
||||
painter->drawEllipse(-12, -12, 25, 25);
|
||||
painter->drawEllipse(-13, -13, 26, 26);
|
||||
|
||||
painter->setPen(QPen(Qt::white, 0));
|
||||
painter->drawText(-10, 3, QString().sprintf("%.2f", value()));
|
||||
if (value() < 0) {
|
||||
painter->setPen(QPen(Qt::red, 0));
|
||||
painter->drawText(-12, 4, QString().sprintf("%.2f", value()));
|
||||
}
|
||||
else {
|
||||
painter->setPen(QPen(Qt::white, 0));
|
||||
painter->drawText(-11, 4, QString().sprintf("%.2f", value()));
|
||||
}
|
||||
}
|
||||
|
||||
void Node::verticalMove(bool flag){
|
||||
|
@ -239,7 +239,7 @@ void MixerCurveWidget::showEvent(QShowEvent *event)
|
||||
|
||||
QRectF rect = plot->boundingRect();
|
||||
|
||||
fitInView(rect.adjusted(-12,-12,12,12), Qt::KeepAspectRatio);
|
||||
fitInView(rect.adjusted(-15,-15,15,15), Qt::KeepAspectRatio);
|
||||
}
|
||||
|
||||
void MixerCurveWidget::resizeEvent(QResizeEvent* event)
|
||||
|
Loading…
x
Reference in New Issue
Block a user