[TD]code review changes for dgh, dpg, dpgi, dra

This commit is contained in:
Wanderer Fan
2022-08-18 15:24:21 -04:00
committed by WandererFan
parent 644b4991e2
commit e8a25a8fdf
4 changed files with 40 additions and 31 deletions

View File

@@ -131,13 +131,14 @@ void DrawProjGroup::onChanged(const App::Property* prop)
return;
}
if ( (prop == &Source) ||
(prop == &XSource) ) {
if ( prop == &Source ||
prop == &XSource ) {
updateChildrenSource();
return;
}
if ((prop == &spacingX) || (prop == &spacingY)) {
if ( prop == &spacingX ||
prop == &spacingY ) {
updateChildrenEnforce();
return;
}
@@ -148,21 +149,21 @@ void DrawProjGroup::onChanged(const App::Property* prop)
}
if (prop == &ScaleType) {
if (ScaleType.isValue("Automatic")) {
//Nothing in particular
} else if (ScaleType.isValue("Page")) {
if (ScaleType.isValue("Page")) {
double newScale = page->Scale.getValue();
if(std::abs(getScale() - newScale) > FLT_EPSILON) {
Scale.setValue(newScale);
updateChildrenScale();
}
} else {
//ScaleType = Custom
}
//DrawView will sort out Scale hidden/readonly/etc
TechDraw::DrawViewCollection::onChanged(prop);
}
// if ( ScaleType.isValue("Automatic") ||
// ScaleType.isValue("Custom") ){
// //just documenting that nothing is required here
// //DrawView::onChanged will sort out Scale hidden/readonly/etc
// }
if (prop == &Rotation) {
if (!DrawUtil::fpCompare(Rotation.getValue(),0.0)) {
Rotation.setValue(0.0);
@@ -284,8 +285,8 @@ bool DrawProjGroup::checkFit(DrawPage* page) const
}
QRectF bigBox = getRect(false);
if ( (bigBox.width() <= page->getPageWidth()) &&
(bigBox.height() <= page->getPageHeight()) ) {
if ( bigBox.width() <= page->getPageWidth() &&
bigBox.height() <= page->getPageHeight() ) {
return true;
}
return false;