From d4aa5eda846a7ab0b448770569549edae4359364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Fri, 20 Oct 2017 00:58:19 +0200 Subject: [PATCH] activate _trim_decimals again --- src/c3nav/mapdata/utils/svg.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/c3nav/mapdata/utils/svg.py b/src/c3nav/mapdata/utils/svg.py index bdb3e558..d438fee9 100644 --- a/src/c3nav/mapdata/utils/svg.py +++ b/src/c3nav/mapdata/utils/svg.py @@ -125,10 +125,8 @@ class SVGImage: f.write(png) def _trim_decimals(self, data): - # remove trailing zeros from a decimal - # deactivated for now, because it costs too much time - return data - # return re.sub(r'([0-9]+)((\.[1-9])[0-9]+|\.[0-9]+)?', r'\1\3', data) + # remove trailing zeros from a decimal – yes this is slow, but it greatly speeds up cairo rendering + return re.sub(r'([0-9]+)((\.[1-9])[0-9]+|\.[0-9]+)?', r'\1\3', data) def _create_geometry(self, geometry, attribs=''): # convert a shapely geometry into an svg xml element