[TD]Fix CosmeticVertex size

This commit is contained in:
wandererfan
2020-06-09 09:06:26 -04:00
committed by WandererFan
parent 134f5fd340
commit dd0273ff4e
5 changed files with 15 additions and 4 deletions

View File

@@ -137,7 +137,7 @@ CosmeticVertex::CosmeticVertex() : TechDraw::Vertex()
permaPoint = Base::Vector3d(0.0, 0.0, 0.0);
linkGeom = -1;
color = Preferences::vertexColor();
size = 3.0;
size = Preferences::vertexScale();
style = 1;
visible = true;
hlrVisible = true;
@@ -165,8 +165,7 @@ CosmeticVertex::CosmeticVertex(Base::Vector3d loc) : TechDraw::Vertex(loc)
permaPoint = loc;
linkGeom = -1;
color = Preferences::vertexColor();
//TODO: size = hGrp->getFloat("VertexSize",30.0);
size = 30.0;
size = Preferences::vertexScale();
style = 1; //TODO: implement styled vertexes
visible = true;
hlrVisible = true;

View File

@@ -206,6 +206,8 @@ void CosmeticVertexPy::setSize(Py::Object arg)
PyObject* p = arg.ptr();
if (PyFloat_Check(p)) {
size = PyFloat_AsDouble(p);
} else if (PyLong_Check(p)) {
size = (double) PyLong_AsLong(p);
} else {
throw Py::TypeError("expected (float)");
}

View File

@@ -126,6 +126,15 @@ App::Color Preferences::vertexColor()
return fcColor;
}
double Preferences::vertexScale()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetFloat("VertexScale", 3.0);
return result;
}
//lightgray #D3D3D3

View File

@@ -53,6 +53,7 @@ static App::Color normalColor();
static App::Color selectColor();
static App::Color preselectColor();
static App::Color vertexColor();
static double vertexScale();
static bool useGlobalDecimals();
static bool keepPagesUpToDate();

View File

@@ -658,7 +658,7 @@ void QGIViewPart::drawViewPart()
// TechDraw::CosmeticVertex* cv = viewPart->getCosmeticVertexByGeom(i);
if (cv != nullptr) {
item->setNormalColor(cv->color.asValue<QColor>());
item->setRadius(cv->size);
item->setRadius(Rez::guiX(cv->size));
} else {
item->setNormalColor(vertexColor);
item->setFillColor(vertexColor);