@leafer-ui/text
Advanced tools
+4
-4
| { | ||
| "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] | ||
| } | ||
| } |
21879
2.06%458
2%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated