Fix Dimension Text Color

- Dimension text did not respect Color property setting.
This commit is contained in:
wandererfan
2019-02-13 15:23:39 -05:00
committed by wmayer
parent 80a7b36da3
commit 428627cd89
4 changed files with 18 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ QGCustomText::QGCustomText()
isHighlighted = false;
m_colCurrent = getNormalColor();
m_colNormal = m_colCurrent;
}
void QGCustomText::centerAt(QPointF centerPos)
@@ -111,7 +112,8 @@ void QGCustomText::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}
void QGCustomText::setPrettyNormal() {
m_colCurrent = getNormalColor();
// m_colCurrent = getNormalColor();
m_colCurrent = m_colNormal;
update();
}

View File

@@ -58,6 +58,7 @@ public:
virtual QColor getNormalColor(void);
virtual QColor getPreColor(void);
virtual QColor getSelectColor(void);
virtual void setColor(QColor c) { m_colNormal = c; }
void makeMark(double x, double y);
void makeMark(Base::Vector3d v);
@@ -70,6 +71,7 @@ protected:
bool isHighlighted;
QColor m_colCurrent;
QColor m_colNormal;
private:

View File

@@ -274,6 +274,13 @@ void QGIDatumLabel::setPrettyNormal(void)
m_tolText->setPrettyNormal();
}
void QGIDatumLabel::setColor(QColor c)
{
m_colNormal = c;
m_dimText->setColor(m_colNormal);
m_tolText->setColor(m_colNormal);
}
//**************************************************************
QGIViewDimension::QGIViewDimension() :
hasHover(false),
@@ -286,6 +293,7 @@ QGIViewDimension::QGIViewDimension() :
datumLabel = new QGIDatumLabel();
addToGroup(datumLabel);
datumLabel->setColor(getNormalColor());
datumLabel->setPrettyNormal();
dimLines = new QGIDimLines();
addToGroup(dimLines);
@@ -482,6 +490,9 @@ void QGIViewDimension::draw()
return;
}
m_colNormal = getNormalColor();
datumLabel->setColor(m_colNormal);
m_lineWidth = Rez::guiX(vp->LineWidth.getValue());
float margin = Rez::guiX(5.f);

View File

@@ -77,6 +77,7 @@ public:
void setPrettySel(void);
void setPrettyPre(void);
void setPrettyNormal(void);
void setColor(QColor c);
QGCustomText* getDimText(void) { return m_dimText; }
void setDimText(QGCustomText* newText) { m_dimText = newText; }
@@ -101,6 +102,7 @@ protected:
QGCustomText* m_tolText;
int getPrecision(void);
double getTolAdjust(void);
QColor m_colNormal;
double posX;
double posY;