r23600 by craig - Cleanup in units.cpp
scribus-commit
scribus-commit at lists.scribus.net
Sun Apr 12 21:41:09 UTC 2020
Author: craig
Date: Sun Apr 12 21:41:08 2020
New Revision: 23600
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23600
Log:
Cleanup in units.cpp
Modified:
trunk/Scribus/scribus/units.cpp
Modified: trunk/Scribus/scribus/units.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23600&path=/trunk/Scribus/scribus/units.cpp
==============================================================================
--- trunk/Scribus/scribus/units.cpp (original)
+++ trunk/Scribus/scribus/units.cpp Sun Apr 12 21:41:08 2020
@@ -311,10 +311,10 @@
double ret = 0.0;
switch (unit)
{
- case 0:
- case 3:
- case 6:
- case 7:
+ case SC_PT:
+ case SC_P:
+ case SC_DEG:
+ case SC_PCT:
ret = unitValue; //don't multiply by 1
break;
default:
@@ -332,10 +332,10 @@
double ret = 0.0;
switch (unit)
{
- case 0:
- case 3:
- case 6:
- case 7:
+ case SC_PT:
+ case SC_P:
+ case SC_DEG:
+ case SC_PCT:
ret = unitValue; // don't divide by 1
break;
default:
@@ -352,11 +352,10 @@
{
if (primaryUnit==secondaryUnit)
return unitValue;
-
- double pts = 0.0, ret = 0.0;
+
//Can make this not convert to points at a later stage, for now, the function exists and works.
- pts = primaryUnit == 0 ? unitValue : unitValue / unitGetRatioFromIndex(primaryUnit);
- ret = secondaryUnit == 0 ? pts : pts * unitGetRatioFromIndex(secondaryUnit);
+ double pts = primaryUnit == 0 ? unitValue : unitValue / unitGetRatioFromIndex(primaryUnit);
+ double ret = secondaryUnit == 0 ? pts : pts * unitGetRatioFromIndex(secondaryUnit);
return ret;
}
More information about the scribus-commit
mailing list