Eliminate some redundant executes

- excessive calls to DrawView::execute were
  slowing data entry in PropertyEditor.
This commit is contained in:
wandererfan
2018-05-04 10:28:03 -04:00
committed by Yorik van Havre
parent 6b91a3ec32
commit 8a183a0ba0
12 changed files with 58 additions and 86 deletions

View File

@@ -266,19 +266,20 @@ void QGIView::updateView(bool update)
} else {
setFlag(QGraphicsItem::ItemIsMovable, true);
}
if (update ||
getViewObject()->X.isTouched() ||
if (getViewObject()->X.isTouched() ||
getViewObject()->Y.isTouched()) {
double featX = Rez::guiX(getViewObject()->X.getValue());
double featY = Rez::guiX(getViewObject()->Y.getValue());
setPosition(featX,featY);
}
if (update ||
getViewObject()->Rotation.isTouched() ) {
if (getViewObject()->Rotation.isTouched() ) {
rotateView();
}
draw();
if (update)
QGraphicsItem::update();
}
@@ -484,8 +485,11 @@ QGIView* QGIView::getQGIVByName(std::string name)
/* static */
Gui::ViewProvider* QGIView::getViewProvider(App::DocumentObject* obj)
{
Gui::Document* guiDoc = Gui::Application::Instance->getDocument(obj->getDocument());
Gui::ViewProvider* result = guiDoc->getViewProvider(obj);
Gui::ViewProvider* result = nullptr;
if (obj != nullptr) {
Gui::Document* guiDoc = Gui::Application::Instance->getDocument(obj->getDocument());
result = guiDoc->getViewProvider(obj);
}
return result;
}