Commit 733023ca authored by dovahkiin's avatar dovahkiin

让图片不会超过psd的范围

parent 1e73c7c1
......@@ -499,6 +499,15 @@ def get_lay_info(psd_info:flag_data):
if is_join_flag:
layer_info_item.layer_name = layer.name
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)
layer_info_list.append(layer_info_item)
......
......@@ -270,6 +270,15 @@ class Pyqt5_Cut_psd(QtWidgets.QMainWindow, Ui_Form):
if psd_name[-4:] != '.psd':
psd_name += '.psd'
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:
self.flag_stop_cut_pic_t = False
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment