Commit 7ce7000a authored by dovahkiin's avatar dovahkiin

加入0.01秒延时,方便主界面更新

加入选择非等大或者非共位时,切图不为偶数的问题。
parent 68e1972b
...@@ -265,6 +265,7 @@ def extractLayerImge(lay_info:lay_item, psd_name:str, lwdtI:QListWidgetItem): ...@@ -265,6 +265,7 @@ def extractLayerImge(lay_info:lay_item, psd_name:str, lwdtI:QListWidgetItem):
brush = QBrush(color) brush = QBrush(color)
lwdtI.setForeground(brush) lwdtI.setForeground(brush)
sleep(0.01)
# print('翻译结果:', temp_layer_name) # print('翻译结果:', temp_layer_name)
exc_c.exc_write(x1, y1, lay_info.w, lay_info.h, layer_name, temp_layer_name, lay_info.layer.name) exc_c.exc_write(x1, y1, lay_info.w, lay_info.h, layer_name, temp_layer_name, lay_info.layer.name)
...@@ -291,13 +292,15 @@ def get_lay_info(psd_info:flag_data): ...@@ -291,13 +292,15 @@ def get_lay_info(psd_info:flag_data):
max_x = layer.left max_x = layer.left
if max_y > layer.top or max_y == -1: if max_y > layer.top or max_y == -1:
max_y = layer.top max_y = layer.top
layer.visible = False layer.visible = False
# temp_psd_show = psd.compose(True) # temp_psd_show = psd.compose(True)
# temp_psd_show.show() # temp_psd_show.show()
layer_info_list:list[lay_item] = [] layer_info_list:list[lay_item] = []
for layer in layer_list: for layer in layer_list:
layer_info_item = lay_item() layer_info_item = lay_item()
if psd_info.cobit: if psd_info.cobit:
layer_info_item.x = max_x layer_info_item.x = max_x
layer_info_item.y = max_y layer_info_item.y = max_y
...@@ -309,8 +312,8 @@ def get_lay_info(psd_info:flag_data): ...@@ -309,8 +312,8 @@ def get_lay_info(psd_info:flag_data):
layer_info_item.w = max_w + 1 if max_w % 2 else max_w layer_info_item.w = max_w + 1 if max_w % 2 else max_w
layer_info_item.h = max_h + 1 if max_h % 2 else max_h layer_info_item.h = max_h + 1 if max_h % 2 else max_h
else: else:
layer_info_item.w = layer.width layer_info_item.w = layer.width + 1 if layer.width % 2 else layer.width
layer_info_item.h = layer.height layer_info_item.h = layer.height + 1 if layer.height % 2 else layer.height
layer_info_item.x = layer.left layer_info_item.x = layer.left
layer_info_item.y = layer.top layer_info_item.y = layer.top
......
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