Fix Part display on property changes

This commit is contained in:
WandererFan 2016-03-24 12:49:31 -04:00 committed by wmayer
parent 32e3c01c2d
commit ac0963c561
3 changed files with 14 additions and 6 deletions

View File

@ -173,7 +173,9 @@ short DrawViewPart::mustExecute() const
ScaleType.isTouched() ||
ShowHiddenLines.isTouched() ||
ShowSmoothLines.isTouched() ||
ShowSeamLines.isTouched());
ShowSeamLines.isTouched() ||
LineWidth.isTouched() ||
HiddenWidth.isTouched());
return result;
}
@ -187,7 +189,9 @@ void DrawViewPart::onChanged(const App::Property* prop)
prop == &ScaleType ||
prop == &ShowHiddenLines ||
prop == &ShowSmoothLines ||
prop == &ShowSeamLines) {
prop == &ShowSeamLines ||
prop == &LineWidth ||
prop == &HiddenWidth ) {
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;

View File

@ -265,6 +265,7 @@ void QGIViewPart::updateView(bool update)
edge->setStrokeWidth(viewPart->LineWidth.getValue() * lineScaleFactor);
}
}
draw();
}
}
@ -381,15 +382,17 @@ void QGIViewPart::drawViewPart()
item->setReference(refs.at(i));
addToGroup(item); //item is at scene(0,0), not group(0,0)
item->setPos(0.0,0.0);
item->setPath(drawPainterPath(*itEdge));
item->setStrokeWidth(lineWidth);
item->setZValue(ZVALUE::EDGE);
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
item->setAcceptHoverEvents(true);
if(!(*itEdge)->visible) {
item->setStrokeWidth(lineWidthHid);
item->setHiddenEdge(true);
item->setZValue(ZVALUE::HIDEDGE);
}
item->setPath(drawPainterPath(*itEdge));
item->setFlag(QGraphicsItem::ItemIsSelectable, true);
item->setAcceptHoverEvents(true);
item->setZValue(ZVALUE::EDGE);
item->setPrettyNormal();
//debug a path
//QPainterPath edgePath=drawPainterPath(*itEdge);
//std::stringstream edgeId;

View File

@ -7,6 +7,7 @@ namespace ZVALUE {
const int SECTIONFACE = 10;
const int FACE = 20;
const int HATCH = 25;
const int HIDEDGE = 27;
const int EDGE = 30;
const int VERTEX = 40;
const int DIMENSION = 50;