forked from revengeday/hit-counter
Readability.
This commit is contained in:
parent
5d1d67836c
commit
a08c8616d1
1 changed files with 4 additions and 4 deletions
|
@ -267,16 +267,16 @@ class ImageHitCounterRenderer extends BaseHitCounterRenderer {
|
|||
* The SVG overlay.
|
||||
*/
|
||||
private createSvgOverlay(width: number, height: number): Buffer {
|
||||
const { textPositionX, textPositionY, fontFace, fontSize, customText, secondaryText, frameColorRGB, drawFrame } = this.config;
|
||||
const { textPositionX, textPositionY, fontFace, fontSize, customText, secondaryText, textColorRGB, secondaryTextColorRGB, frameColorRGB, drawFrame, borderWidth } = this.config;
|
||||
const frame = drawFrame
|
||||
? `<rect x="0" y="0" width="100%" height="100%" fill="none" stroke="rgb(${frameColorRGB.r},${frameColorRGB.g},${frameColorRGB.b})" stroke-width="${this.config.borderWidth}" />`
|
||||
? `<rect x="0" y="0" width="100%" height="100%" fill="none" stroke="rgb(${frameColorRGB.r},${frameColorRGB.g},${frameColorRGB.b})" stroke-width="${borderWidth}" />`
|
||||
: '';
|
||||
|
||||
const svg = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
|
||||
<text y="${textPositionY}" font-family="${fontFace}" font-size="${fontSize}">
|
||||
<tspan x="${textPositionX}" dy="0" fill="rgb(${this.config.textColorRGB.r},${this.config.textColorRGB.g},${this.config.textColorRGB.b})">${customText}</tspan>
|
||||
<tspan x="${textPositionX}" dy="1.2em" fill="rgb(${this.config.secondaryTextColorRGB.r},${this.config.secondaryTextColorRGB.g},${this.config.secondaryTextColorRGB.b})">${secondaryText}</tspan>
|
||||
<tspan x="${textPositionX}" dy="0" fill="rgb(${textColorRGB.r},${textColorRGB.g},${textColorRGB.b})">${customText}</tspan>
|
||||
<tspan x="${textPositionX}" dy="1.2em" fill="rgb(${secondaryTextColorRGB.r},${secondaryTextColorRGB.g},${secondaryTextColorRGB.b})">${secondaryText}</tspan>
|
||||
</text>
|
||||
${frame}
|
||||
</svg>`;
|
||||
|
|
Loading…
Reference in a new issue