You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer-ui/text

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer-ui/text - npm Package Compare versions

Comparing version
1.5.1
to
1.5.2
+4
-4
package.json
{
"name": "@leafer-ui/text",
"version": "1.5.1",
"version": "1.5.2",
"description": "@leafer-ui/text",

@@ -25,8 +25,8 @@ "author": "Chao (Leafer) Wan",

"dependencies": {
"@leafer/core": "1.5.1"
"@leafer/core": "1.5.2"
},
"devDependencies": {
"@leafer/interface": "1.5.1",
"@leafer-ui/interface": "1.5.1"
"@leafer/interface": "1.5.2",
"@leafer-ui/interface": "1.5.2"
}
}

@@ -1,14 +0,24 @@

import { ITextData, ITextDrawData } from '@leafer-ui/interface'
import { ITextData, ITextDecorationType, ITextDrawData } from '@leafer-ui/interface'
import { ColorConvert } from '@leafer-ui/draw'
export function decorationText(drawData: ITextDrawData, style: ITextData): void {
const { fontSize } = style
let type: ITextDecorationType
const { fontSize, textDecoration } = style
drawData.decorationHeight = fontSize / 11
switch (style.textDecoration) {
if (typeof textDecoration === 'object') {
type = textDecoration.type
if (textDecoration.color) drawData.decorationColor = ColorConvert.string(textDecoration.color)
} else type = textDecoration
switch (type) {
case 'under':
drawData.decorationY = fontSize * 0.15
drawData.decorationY = [fontSize * 0.15]
break
case 'delete':
drawData.decorationY = -fontSize * 0.35
drawData.decorationY = [-fontSize * 0.35]
break
case 'under-delete':
drawData.decorationY = [fontSize * 0.15, -fontSize * 0.35]
}
}