Simplify/beautify example

This commit is contained in:
Andreas Hocevar
2022-04-15 13:13:39 +02:00
parent 585ae66961
commit e8f151543d

View File

@@ -67,26 +67,19 @@ function createStyle({textAlign, justify}) {
stroke: new Stroke({color: 'red', width: 1}), stroke: new Stroke({color: 'red', width: 1}),
}), }),
text: new Text({ text: new Text({
font: '16px sans-serif',
textAlign, textAlign,
justify, justify,
text: [ text:
'long text to emphasize justify', `Justify text inside box\ntextAlign: ${textAlign}` +
'', (justify ? `\njustify: ${justify}` : ''),
'\n',
'',
`textAlign: ${textAlign}`,
'',
'\n',
'',
`justify: ${justify}`,
'',
],
fill: new Fill({ fill: new Fill({
color: [255, 255, 255, 1], color: [255, 255, 255, 1],
}), }),
backgroundFill: new Fill({ backgroundFill: new Fill({
color: [168, 50, 153, 0.8], color: [168, 50, 153, 0.6],
}), }),
padding: [2, 2, 2, 2],
}), }),
}); });
} }