Simplify/beautify example
This commit is contained in:
@@ -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],
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user