Commit 8ee43595 authored by heindlalex's avatar heindlalex Committed by mrbean-bremen
Browse files

Unit Calculation: add spaces between operatores, remove obsolete default...

Unit Calculation: add spaces between operatores, remove obsolete default branch in switch statement.
bug fix #338
parent a7e5913f
......@@ -166,15 +166,12 @@ namespace Svg
break;
case UnitRenderingType.Other:
// Calculate a percentage value of the normalized viewBox diagonal length.
if (owner.OwnerDocument != null && owner.OwnerDocument.ViewBox != null && owner.OwnerDocument.ViewBox.Width!=0 && owner.OwnerDocument.ViewBox.Height != 0)
if (owner.OwnerDocument != null && owner.OwnerDocument.ViewBox != null && owner.OwnerDocument.ViewBox.Width != 0 && owner.OwnerDocument.ViewBox.Height != 0)
{
_deviceValue = (float)(Math.Sqrt(Math.Pow(owner.OwnerDocument.ViewBox.Width, 2) + Math.Pow(owner.OwnerDocument.ViewBox.Height, 2)) / Math.Sqrt(2) * value / 100.0);
}
else _deviceValue = (float)(Math.Sqrt(Math.Pow(size.Width, 2) + Math.Pow(size.Height, 2)) / Math.Sqrt(2) * value / 100.0);
break;
default:
_deviceValue = (float)(Math.Sqrt(Math.Pow(size.Width, 2) + Math.Pow(size.Height, 2)) / Math.Sqrt(2) * value / 100.0);
break;
}
break;
default:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment