Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
psd-parse-web
Commits
862d9720
Commit
862d9720
authored
May 08, 2021
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文本宽度增大
parent
5feb8774
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
package.json
package.json
+1
-1
compilelocal.js
src/compilelocal.js
+3
-0
No files found.
package.json
View file @
862d9720
{
{
"name"
:
"psd-parse-web"
,
"name"
:
"psd-parse-web"
,
"version"
:
"2.0.
0
"
,
"version"
:
"2.0.
1
"
,
"main"
:
"src/index.js"
,
"main"
:
"src/index.js"
,
"module"
:
"dist/index.es.js"
,
"module"
:
"dist/index.es.js"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/compilelocal.js
View file @
862d9720
...
@@ -103,9 +103,12 @@ async function compilePsdToJson(psdFile, options) {
...
@@ -103,9 +103,12 @@ async function compilePsdToJson(psdFile, options) {
const
colors
=
fontInfo
.
colors
();
const
colors
=
fontInfo
.
colors
();
let
fsize
=
computeFontSize
(
fontInfo
)
let
fsize
=
computeFontSize
(
fontInfo
)
properties
.
style
.
fontSize
=
parseInt
(
fsize
);
//字体取整
properties
.
style
.
fontSize
=
parseInt
(
fsize
);
//字体取整
//字体取整情况下有可能导致宽度不够,默认扩大10像素
viewNode
.
properties
.
style
.
width
+=
10
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
style
.
color
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
viewNode
.
nodeType
=
'Label'
;
viewNode
.
nodeType
=
'Label'
;
dealLater
=
false
;
dealLater
=
false
;
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
}
else
if
(
solidColor
&&
layer
.
vectorMask
)
{
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment