@@ -661,6 +661,11 @@ def process_elements(array):
661
661
l3_shape_width = tmp_tmp_l3_add_shape_array [3 ]
662
662
l3_shape_hight = tmp_tmp_l3_add_shape_array [4 ]
663
663
l3_shape_text = tmp_tmp_l3_add_shape_array [5 ]
664
+
665
+ # add at ver 2.4.1
666
+ if self .flag_re_create == True and self .flag_second_page == False and action_type == 'CREATE' :
667
+ l3_shape_top -= (self .per_index2_before_array [self .index_2 ] - self .per_index2_after_array [self .index_2 ])
668
+
664
669
self .shape = self .slide .shapes
665
670
ns_ddx_figure .extended .add_shape (self , l3_shape_type , l3_shape_left , l3_shape_top , l3_shape_width , l3_shape_hight , l3_shape_text )
666
671
@@ -702,13 +707,17 @@ def process_elements(array):
702
707
703
708
if '_AIR_' not in shape_text :
704
709
if action_type == 'CREATE' :
710
+ # add at ver 2.4.1
711
+ if self .flag_re_create == True and self .flag_second_page == False :
712
+ shape_top -= (self .per_index2_before_array [self .index_2 ] - self .per_index2_after_array [self .index_2 ])
713
+
705
714
self .shape = self .slide .shapes
706
715
ns_ddx_figure .extended .add_shape (self , shape_type , shape_left , shape_top , shape_width , shape_hight , shape_text )
707
716
self .slide .shapes ._spTree .remove (self .shape ._element ) # move shape to back layer
708
717
self .slide .shapes ._spTree .insert (2 , self .shape ._element ) # move shape to back layer
709
718
710
719
if self .click_value_l3 == 'L3-4-1' :
711
- self .add_shape_array .append ([shape_type , shape_left , shape_top , shape_width , shape_hight , shape_text ]) # add ver 2.3.3
720
+ self .add_shape_array .append ([shape_type , shape_left , shape_top , shape_width , shape_hight , shape_text ]) # add ver 2.3.3
712
721
713
722
'''GET Folder and Outline position'''
714
723
# get folder left
@@ -911,6 +920,15 @@ def process_elements(array):
911
920
912
921
l3segment_line_array .append ([[start_l3_seg_inche_x ,end_l3_seg_inche_x ],tmp_l3segment_y_array ,return_get_l3_segment_num [1 ]])
913
922
923
+ ### add at ver 2.4.1
924
+ if self .flag_re_create == True and self .flag_second_page == False and tmp_l3segment_y_array != [] and action_type == 'CREATE' :
925
+ self .per_index2_after_array .append (max (tmp_l3segment_y_array ))
926
+ #print(self.per_index2_before_array)
927
+ #print(self.per_index2_after_array)
928
+
929
+ elif self .flag_re_create == False and self .flag_second_page == False and tmp_l3segment_y_array != [] and action_type == 'CREATE' :
930
+ self .per_index2_before_array .append (max (tmp_l3segment_y_array ))
931
+
914
932
'''change offset check_move_to_right '''
915
933
top_offset += shape_hight + between_shape_row
916
934
@@ -1291,10 +1309,11 @@ def process_elements(array):
1291
1309
if '_wp_' not in tmp_area_outline_array [0 ]:
1292
1310
self .shape = self .slide .shapes
1293
1311
folder_shape_left = tmp_area_outline_array [1 ] - area_margin_x
1294
- folder_shape_top = tmp_area_outline_array [2 ]- area_margin_y
1312
+ folder_shape_top = tmp_area_outline_array [2 ] - area_margin_y
1295
1313
folder_shape_width = tmp_area_outline_array [3 ] + (area_margin_x * 2 )
1296
1314
folder_shape_hight = tmp_area_outline_array [4 ] + (area_margin_y * 2 )
1297
1315
folder_shape_text = tmp_area_outline_array [0 ]
1316
+
1298
1317
ns_ddx_figure .extended .add_shape (self , folder_shape_type , folder_shape_left , folder_shape_top ,folder_shape_width , folder_shape_hight , folder_shape_text )
1299
1318
self .slide .shapes ._spTree .remove (self .shape ._element ) # move shape to back layer
1300
1319
self .slide .shapes ._spTree .insert (2 , self .shape ._element ) # move shape to back layer
@@ -1636,7 +1655,7 @@ def get_optimize_y_grid_array(self):
1636
1655
#print('[index_5,[shape_left, shape_top, shape_width, shape_hight]]')
1637
1656
#print(self.y_grid_segment_array)
1638
1657
y_grid_segment_per_inches = 0.25 #inches
1639
- x_grid_segment_buffer = 0.05 #inches
1658
+ x_grid_segment_buffer = 0.03 #inches
1640
1659
1641
1660
# Iterate through the list and group shapes by index_5
1642
1661
shapes_by_index = {}
@@ -1675,8 +1694,8 @@ def get_optimize_y_grid_array(self):
1675
1694
#Check to overlapping [shape_left, shape_top, shape_width, shape_hight]
1676
1695
#print('overlap check---> ', (tmp_kari_done_y_grid_segment_array[1][0] + tmp_kari_done_y_grid_segment_array[1][2]) ,x_grid_segment_buffer,candidate_y_grid_segment_shape[0],tmp_kari_done_y_grid_segment_array[1][1], candidate_shape_top)
1677
1696
1678
- if round ((tmp_kari_done_y_grid_segment_array [1 ][0 ] + tmp_kari_done_y_grid_segment_array [1 ][2 ] - x_grid_segment_buffer ), 3 ) >= round (candidate_y_grid_segment_shape [0 ], 3 ) and \
1679
- round ((tmp_kari_done_y_grid_segment_array [1 ][0 ] + x_grid_segment_buffer ), 3 ) <= round (candidate_y_grid_segment_shape [0 ] + candidate_y_grid_segment_shape [2 ], 3 ):
1697
+ if round ((tmp_kari_done_y_grid_segment_array [1 ][0 ] + tmp_kari_done_y_grid_segment_array [1 ][2 ] + x_grid_segment_buffer ), 3 ) >= round (candidate_y_grid_segment_shape [0 ], 3 ) and \
1698
+ round ((tmp_kari_done_y_grid_segment_array [1 ][0 ] - x_grid_segment_buffer ), 3 ) <= round (candidate_y_grid_segment_shape [0 ] + candidate_y_grid_segment_shape [2 ], 3 ):
1680
1699
if round (tmp_kari_done_y_grid_segment_array [1 ][1 ], 3 ) == round (candidate_shape_top , 3 ):
1681
1700
#partial overlap
1682
1701
if last_shape_top < (candidate_shape_top + y_grid_segment_per_inches ):
@@ -1699,7 +1718,7 @@ def get_optimize_y_grid_array(self):
1699
1718
#print('<append written array> --> ',[tmp_shapes_by_index,[candidate_y_grid_segment_shape[0],last_shape_top,candidate_y_grid_segment_shape[2],candidate_y_grid_segment_shape[3]]])
1700
1719
kari_done_y_grid_segment_array .append ([tmp_shapes_by_index ,[candidate_y_grid_segment_shape [0 ],last_shape_top ,candidate_y_grid_segment_shape [2 ],candidate_y_grid_segment_shape [3 ]]])
1701
1720
1702
- print ('<<one line array>> --> ' ,kari_done_y_grid_segment_array )
1721
+ # print('<<one line array>> --> ',kari_done_y_grid_segment_array)
1703
1722
done_y_grid_segment_array = done_y_grid_segment_array + kari_done_y_grid_segment_array
1704
1723
#print('done_y_grid_segment_array --> ',done_y_grid_segment_array)
1705
1724
return done_y_grid_segment_array
0 commit comments