mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2024-12-25 03:08:26 +00:00
修复 文本图层 进行矩阵缩放后字体显示不正确的问题
This commit is contained in:
parent
963a48256a
commit
de9596375e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
6
psd2ui-tools/dist/index.js
vendored
6
psd2ui-tools/dist/index.js
vendored
@ -1549,7 +1549,13 @@
|
||||
}
|
||||
}
|
||||
this.text = textSource.text;
|
||||
// 可能会对文本图层进行缩放,这里计算缩放之后的时机字体大小
|
||||
if (Math.abs(1 - textSource.transform[0]) > 0.001) {
|
||||
this.fontSize = Math.round(style.fontSize * textSource.transform[0] * 100) / 100;
|
||||
}
|
||||
else {
|
||||
this.fontSize = style.fontSize;
|
||||
}
|
||||
this.offsetY = config.textOffsetY[this.fontSize] || config.textOffsetY["default"] || 0;
|
||||
this.parseSolidFill();
|
||||
this.parseStroke();
|
||||
|
@ -12,6 +12,7 @@
|
||||
"test-init": "node dist/index.js --init --project-assets ./out/ --cache E:\\Git\\ccc-framework-3d\\tools\\psd2ui\\cache\\cache.json",
|
||||
"test-png9": "ts-node src/index.ts --engine-version v342 --pinyin --input ./test/png9.psd --output ./out/",
|
||||
"test-png9-2": "node dist/index.js --engine-version v342 --pinyin --input ./test/png9.psd --output ./out/",
|
||||
"test-dpi": "ts-node src/index.ts --engine-version v342 --pinyin --input ./test/dpi-test.psd --output ./out/",
|
||||
"test-same-name": "ts-node src/index.ts --engine-version v342 --pinyin --input ./test/sameName.psd --output ./out/"
|
||||
},
|
||||
"author": "",
|
||||
|
@ -25,7 +25,14 @@ export class PsdText extends PsdLayer{
|
||||
}
|
||||
}
|
||||
this.text = textSource.text;
|
||||
|
||||
// 可能会对文本图层进行缩放,这里计算缩放之后的时机字体大小
|
||||
if (Math.abs(1 - textSource.transform[0]) > 0.001) {
|
||||
this.fontSize = Math.round(style.fontSize * textSource.transform[0] * 100) / 100;
|
||||
} else {
|
||||
this.fontSize = style.fontSize;
|
||||
}
|
||||
|
||||
|
||||
this.offsetY = config.textOffsetY[this.fontSize] || config.textOffsetY["default"] || 0;
|
||||
|
||||
|
@ -188,7 +188,7 @@ function reWriteVersion() {
|
||||
}
|
||||
|
||||
cocosVersion = "v3.4.+"
|
||||
//cocosVersion = "v2.4.x"
|
||||
cocosVersion = "v2.4.x"
|
||||
|
||||
const pluginVersion = "1.0.3"; // 打包之前记得修改这里的版本号,第三位为只更新lib文件,前两位为更新整个插件。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user