Fix delayed painting

- Annotation and Image were not being painted
  immediately, but had to wait for a page
  refresh.
This commit is contained in:
wandererfan
2018-05-16 13:39:03 -04:00
parent 1ff736e282
commit fca8034b18
5 changed files with 10 additions and 14 deletions

View File

@@ -89,14 +89,9 @@ void DrawViewAnnotation::onChanged(const App::Property* prop)
prop == &TextColor ||
prop == &TextSize ||
prop == &LineSpace ||
prop == &TextStyle || //changing this doesn't recompute until focus changes??
prop == &TextStyle ||
prop == &MaxWidth) {
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;
}
catch (...) {
}
requestPaint();
}
}
TechDraw::DrawView::onChanged(prop);

View File

@@ -66,6 +66,7 @@ void DrawViewImage::onChanged(const App::Property* prop)
{
if (prop == &ImageFile) {
if (!isRestoring()) {
requestPaint();
}
}
TechDraw::DrawView::onChanged(prop);
@@ -73,6 +74,7 @@ void DrawViewImage::onChanged(const App::Property* prop)
App::DocumentObjectExecReturn *DrawViewImage::execute(void)
{
requestPaint();
return DrawView::execute();
}

View File

@@ -111,9 +111,8 @@ void QGIViewAnnotation::draw()
}
drawAnnotation();
if (borderVisible) {
drawBorder();
}
QGIView::draw();
}
//TODO: text is positioned slightly high (and left??) on page save to SVG file

View File

@@ -121,9 +121,8 @@ void QGIViewImage::draw()
m_cliparea->setRect(newRect);
drawImage();
m_cliparea->centerAt(0.0,0.0);
if (borderVisible) {
drawBorder();
}
QGIView::draw();
}
void QGIViewImage::drawImage()

View File

@@ -204,7 +204,8 @@ int QGVPage::addQView(QGIView *view)
}
view->setPos(viewPos);
view->updateView(true);
return 0;
}