[TD]Fix CosmeticVertex size
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user