From d978175d80002204a4c20ca5f19ee794fbcdbdbd Mon Sep 17 00:00:00 2001 From: Joxit Date: Tue, 18 Apr 2023 16:45:32 +0200 Subject: [PATCH] chore: format and cleanup symbol-render --- src/components/symbol-render.riot | 36 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/components/symbol-render.riot b/src/components/symbol-render.riot index af603b6..f9348e6 100644 --- a/src/components/symbol-render.riot +++ b/src/components/symbol-render.riot @@ -14,11 +14,7 @@
id - + { symbol.id }
@@ -44,24 +40,32 @@ .reduce(taxonomy.generateLayersWithMatches(), []) .map((layer) => { if (layer.paint['text-halo-color']) { - this.state.casing[layer.id] = taxonomy.widthAndColorByZooms(layer, { - 'text-width': layer.paint['text-halo-width'], - 'text-color': layer.paint['text-halo-color'], - zooms: this.props.zooms, - }, 'text'); + this.state.casing[layer.id] = taxonomy.widthAndColorByZooms( + layer, + { + 'text-width': layer.paint['text-halo-width'], + 'text-color': layer.paint['text-halo-color'], + zooms: this.props.zooms, + }, + 'text' + ); } - const res = taxonomy.widthAndColorByZooms(layer, { - 'text-width': layer.layout['text-size'], - 'text-color': layer.paint['text-color'], - zooms: this.props.zooms, - }, 'text'); + const res = taxonomy.widthAndColorByZooms( + layer, + { + 'text-width': layer.layout['text-size'], + 'text-color': layer.paint['text-color'], + zooms: this.props.zooms, + }, + 'text' + ); res.id = layer.name || layer.id; res['text-transform'] = layer.layout['text-transform'] || 'none'; res.example = layer.metadata['taxonomy:example']; const fontProps = taxonomy.fonts.getProps(layer.layout['text-font'][0]); res.fontProps = fontProps; taxonomy.fonts.add(fontProps); - return {fontProps, ...res}; + return res; }); this.update(); },