Implement automatic scaling

This commit is contained in:
WandererFan
2016-08-05 14:12:47 -04:00
committed by wmayer
parent fa57b7a5de
commit cf90d69319
16 changed files with 198 additions and 78 deletions

View File

@@ -155,3 +155,14 @@ App::DocumentObjectExecReturn *DrawViewCollection::execute(void)
return DrawView::execute();
}
QRectF DrawViewCollection::getRect() const
{
QRectF result;
for (auto& v:Views.getValues()) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(v);
result = result.united(view->getRect().translated(view->X.getValue(),view->Y.getValue()));
}
return QRectF(0,0,Scale.getValue() * result.width(),Scale.getValue() * result.height());
}