Handle stop offsets in percentages. Convert stop offsets into floating point (or integer if possible)

This commit is contained in:
JSCHILL1 2009-04-27 19:19:05 -05:00
parent efbdd3a027
commit 321f16c46d
3 changed files with 117 additions and 86 deletions

View file

@ -189,6 +189,13 @@ class RemoveDuplicateLinearGradientStops(unittest.TestCase):
self.assertEquals(len(grad[0].getElementsByTagNameNS(SVGNS, 'stop')), 3,
'Duplicate linear gradient stops not removed' )
class RemoveDuplicateLinearGradientStopsPct(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/duplicate-gradient-stops-pct.svg')
grad = doc.getElementsByTagNameNS(SVGNS, 'linearGradient')
self.assertEquals(len(grad[0].getElementsByTagNameNS(SVGNS, 'stop')), 3,
'Duplicate linear gradient stops with percentages not removed' )
class RemoveDuplicateRadialGradientStops(unittest.TestCase):
def runTest(self):
doc = scour.scourXmlFile('unittests/duplicate-gradient-stops.svg')