@@ -522,14 +522,15 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
522
522
ref = sourceModule .Reference ().GetText ()
523
523
prodIDs .append ([sourceModule .GetPropertyNative ("PROD_ID" ), ref ])
524
524
else : # Move source modules which are outside the bounding box
525
- # If the drawing is below the bottom edge and likely to clip the rail, move it below the rail
526
- if (pos .y > boardBottomEdge ) and (pos .y < (boardBottomEdge + (2 * int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))):
527
- sourceModule .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
528
- elif pos .y < boardTopEdge : # If the drawing is above the top edge, move it above the panel
525
+ # If the module is below the bottom edge and likely to clip the rail, move it below the rail
526
+ if pos .y > boardBottomEdge :
527
+ if pos .y < (boardBottomEdge + (2 * int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))):
528
+ sourceModule .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
529
+ elif pos .y < boardTopEdge : # If the module is above the top edge, move it above the panel
529
530
sourceModule .Move (pcbnew .VECTOR2I (0 , int ((- (NUM_Y - 1 ) * boardHeight ) - (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))))
530
- elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
531
+ elif pos .x > boardRightEdge : # If the module is to the right, move it beyond the panel
531
532
sourceModule .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
532
- else : # elif pos.x < boardLeftEdge: # If the drawing is to the left, move it outside the rail
533
+ else : # elif pos.x < boardLeftEdge: # If the module is to the left, move it outside the rail
533
534
sourceModule .Move (pcbnew .VECTOR2I (int (- VERTICAL_EDGE_RAIL_WIDTH * SCALE ), 0 ))
534
535
535
536
for module in newModules :
@@ -620,12 +621,12 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
620
621
#if txt is not None: # Copy all text outside the bounding box to the report
621
622
# report += txt + "\n"
622
623
if pos .y > boardBottomEdge : # If the drawing is below the bottom edge, move it below the rail
623
- if pos .y < (boardBottomEdge + (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )): # But only if in the way
624
+ if pos .y < (boardBottomEdge + (2 * int ( HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ) )): # But only if in the way
624
625
sourceDrawing .Move (pcbnew .VECTOR2I (0 , int (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE )))
625
- elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
626
- sourceDrawing .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
627
626
elif pos .y < boardTopEdge : # If the drawing is above the top edge, move it above the panel
628
627
sourceDrawing .Move (pcbnew .VECTOR2I (0 , int ((- (NUM_Y - 1 ) * boardHeight ) - (HORIZONTAL_EDGE_RAIL_WIDTH * SCALE ))))
628
+ elif pos .x > boardRightEdge : # If the drawing is to the right, move it beyond the panel
629
+ sourceDrawing .Move (pcbnew .VECTOR2I (int (((NUM_X - 1 ) * boardWidth ) + (VERTICAL_EDGE_RAIL_WIDTH * SCALE )), 0 ))
629
630
else : # elif pos.x < boardLeftEdge: # If the drawing is to the left, move it outside the rail
630
631
sourceDrawing .Move (pcbnew .VECTOR2I (int (- VERTICAL_EDGE_RAIL_WIDTH * SCALE ), 0 ))
631
632
0 commit comments