From e8f151543d055b00f71097a89fa8d96002719c03 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Fri, 15 Apr 2022 13:13:39 +0200 Subject: [PATCH] Simplify/beautify example --- examples/vector-labels-justify-text.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/examples/vector-labels-justify-text.js b/examples/vector-labels-justify-text.js index f32b28e10e..a0dbfd94b3 100644 --- a/examples/vector-labels-justify-text.js +++ b/examples/vector-labels-justify-text.js @@ -67,26 +67,19 @@ function createStyle({textAlign, justify}) { stroke: new Stroke({color: 'red', width: 1}), }), text: new Text({ + font: '16px sans-serif', textAlign, justify, - text: [ - 'long text to emphasize justify', - '', - '\n', - '', - `textAlign: ${textAlign}`, - '', - '\n', - '', - `justify: ${justify}`, - '', - ], + text: + `Justify text inside box\ntextAlign: ${textAlign}` + + (justify ? `\njustify: ${justify}` : ''), fill: new Fill({ color: [255, 255, 255, 1], }), backgroundFill: new Fill({ - color: [168, 50, 153, 0.8], + color: [168, 50, 153, 0.6], }), + padding: [2, 2, 2, 2], }), }); }