src/reportlab/platypus/paraparser.py
changeset 4315 7c65c6e52b13
parent 4277 838129322a55
child 4330 617ffa6bbdc8
--- a/src/reportlab/platypus/paraparser.py	Thu Feb 02 15:53:11 2017 +0000
+++ b/src/reportlab/platypus/paraparser.py	Tue Feb 07 11:19:18 2017 +0000
@@ -91,13 +91,20 @@
     else:
         return _num(s,unit,allowRelative)
 
-class _PCT:
-    def __init__(self,v):
-        self._value = v*0.01
+class _PCT(float):
+    def __new__(cls,v):
+        self = float.__new__(cls,v*0.01)
+        self._normalizer = 1.0
+        self._value = v
+        return self
 
     def normalizedValue(self,normalizer):
-        normalizer = normalizer or getattr(self,'_normalizer')
-        return normalizer*self._value
+        if not normalizer:
+            normaliser = self._normalizer
+        r = _PCT(normalizer*self._value)
+        r._value = self._value
+        r._normalizer = normalizer
+        return r
 
 def fontSizeNormalize(frag,attr,default):
     if not hasattr(frag,attr): return default