mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2024-12-25 03:08:26 +00:00
修复 png9 bug
This commit is contained in:
parent
de9596375e
commit
0d90c0b6dd
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
6
psd2ui-tools/cmd.bat
Normal file
6
psd2ui-tools/cmd.bat
Normal file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
echo psd2ui:: Drag and drop a file or folder
|
||||
set /p var=
|
||||
|
||||
node ./dist/index.js --engine-version v342 --pinyin --input %var%
|
||||
pause
|
16
psd2ui-tools/cmd.sh
Normal file
16
psd2ui-tools/cmd.sh
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
# node ./dist/index.js
|
||||
# exec /bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
#============ get the file name ===========
|
||||
|
||||
echo -e "导出表格数据:拖拽想要处理的文件和文件夹到此"
|
||||
|
||||
read InputDir
|
||||
|
||||
echo "导出数据"
|
||||
|
||||
node dist/index.js --engine-version v342 --pinyin --input "${InputDir}"
|
||||
|
||||
exec /bin/bash
|
4
psd2ui-tools/dist/index.js
vendored
4
psd2ui-tools/dist/index.js
vendored
@ -1457,7 +1457,9 @@
|
||||
console.log(`Texture9Utils-> 设置的九宫格 bottom, top 数据不合理,请重新设置`);
|
||||
return _canvas;
|
||||
}
|
||||
let newCanvas = canvas__default["default"].createCanvas(Math.min(cw, border.l + border.r + space) || cw, Math.min(ch, border.b + border.t + space) || ch);
|
||||
let imgW = border.l + border.r == 0 ? cw : Math.min(cw, border.l + border.r + space);
|
||||
let imgH = border.b + border.t == 0 ? ch : Math.min(ch, border.b + border.t + space);
|
||||
let newCanvas = canvas__default["default"].createCanvas(imgW, imgH);
|
||||
let ctx = newCanvas.getContext("2d");
|
||||
// 左上
|
||||
ctx.drawImage(_canvas, 0, 0, left + space, top + space, 0, 0, left + space, top + space);
|
||||
|
@ -40,7 +40,9 @@ export class Texture9Utils {
|
||||
return _canvas;
|
||||
}
|
||||
|
||||
let newCanvas = canvas.createCanvas(Math.min(cw, border.l + border.r + space) || cw, Math.min(ch, border.b + border.t + space) || ch);
|
||||
let imgW = border.l + border.r == 0 ? cw : Math.min(cw, border.l + border.r + space);
|
||||
let imgH = border.b + border.t == 0 ? ch : Math.min(ch, border.b + border.t + space);
|
||||
let newCanvas = canvas.createCanvas(imgW, imgH);
|
||||
let ctx = newCanvas.getContext("2d");
|
||||
|
||||
// 左上
|
||||
|
Loading…
Reference in New Issue
Block a user