[TechDraw] Simplify return logic

This commit is contained in:
Benjamin Bræstrup Sayoc
2023-04-09 16:34:23 +02:00
committed by WandererFan
parent 5d05acc87e
commit 3794897699
14 changed files with 20 additions and 42 deletions

View File

@@ -571,20 +571,18 @@ void DrawView::setScaleAttribute()
int DrawView::prefScaleType()
{
int result = Preferences::getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);
return result;
return Preferences::getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);
}
double DrawView::prefScale()
{
double result = Preferences::getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
if (ScaleType.isValue("Page")) {
auto page = findParentPage();
if (page) {
result = page->Scale.getValue();
return page->Scale.getValue();
}
}
return result;
return Preferences::getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
}
void DrawView::requestPaint()