Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cut_pic
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
dovahkiin
cut_pic
Commits
733023ca
Commit
733023ca
authored
Apr 15, 2024
by
dovahkiin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
让图片不会超过psd的范围
parent
1e73c7c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
cut_pic.py
cut_pic.py
+9
-0
ui_main.py
ui_main.py
+9
-0
No files found.
cut_pic.py
View file @
733023ca
...
@@ -499,6 +499,15 @@ def get_lay_info(psd_info:flag_data):
...
@@ -499,6 +499,15 @@ def get_lay_info(psd_info:flag_data):
if
is_join_flag
:
if
is_join_flag
:
layer_info_item
.
layer_name
=
layer
.
name
layer_info_item
.
layer_name
=
layer
.
name
layer_info_item
.
layer
=
layer
layer_info_item
.
layer
=
layer
if
layer_info_item
.
x
<
0
:
layer_info_item
.
w
=
layer_info_item
.
w
+
layer_info_item
.
x
layer_info_item
.
x
=
0
if
layer_info_item
.
y
<
0
:
layer_info_item
.
h
=
layer_info_item
.
h
+
layer_info_item
.
y
layer_info_item
.
y
=
0
print
(
layer_info_item
)
print
(
layer_info_item
)
layer_info_list
.
append
(
layer_info_item
)
layer_info_list
.
append
(
layer_info_item
)
...
...
ui_main.py
View file @
733023ca
...
@@ -270,6 +270,15 @@ class Pyqt5_Cut_psd(QtWidgets.QMainWindow, Ui_Form):
...
@@ -270,6 +270,15 @@ class Pyqt5_Cut_psd(QtWidgets.QMainWindow, Ui_Form):
if
psd_name
[
-
4
:]
!=
'.psd'
:
if
psd_name
[
-
4
:]
!=
'.psd'
:
psd_name
+=
'.psd'
psd_name
+=
'.psd'
for
lay_info
in
self
.
lay_info_s
[
psd_name
]:
for
lay_info
in
self
.
lay_info_s
[
psd_name
]:
if
lay_info
.
x
<
0
:
lay_info
.
w
=
lay_info
.
w
+
lay_info
.
x
lay_info
.
x
=
0
if
lay_info
.
y
<
0
:
lay_info
.
h
=
lay_info
.
h
+
lay_info
.
y
lay_info
.
y
=
0
if
self
.
flag_stop_cut_pic_t
:
if
self
.
flag_stop_cut_pic_t
:
self
.
flag_stop_cut_pic_t
=
False
self
.
flag_stop_cut_pic_t
=
False
return
return
...
...
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