@@ -203,13 +203,19 @@ def shape_to_param(self) -> None:
203203 elif isinstance (self .shape , AnnotatedSegment ):
204204 assert isinstance (p , cdl .param .SegmentProfileParam )
205205 x1 , y1 , x2 , y2 = self .shape .get_rect ()
206- p .row1 , p .row2 = sorted ([int (np .round (y1 )), int (np .round (y2 ))])
207- p .col1 , p .col2 = sorted ([int (np .round (x1 )), int (np .round (x2 ))])
206+ p .row1 , p .row2 = int (np .round (y1 )), int (np .round (y2 ))
207+ p .col1 , p .col2 = int (np .round (x1 )), int (np .round (x2 ))
208+ if p .col1 > p .col2 :
209+ p .col1 , p .col2 = p .col2 , p .col1
210+ p .row1 , p .row2 = p .row2 , p .row1
208211 else :
209212 assert isinstance (p , cdl .param .AverageProfileParam )
210213 x1 , y1 , x2 , y2 = self .shape .get_rect ()
211- p .row1 , p .row2 = sorted ([int (np .round (y1 )), int (np .round (y2 ))])
212- p .col1 , p .col2 = sorted ([int (np .round (x1 )), int (np .round (x2 ))])
214+ p .row1 , p .row2 = int (np .round (y1 )), int (np .round (y2 ))
215+ p .col1 , p .col2 = int (np .round (x1 )), int (np .round (x2 ))
216+ if p .col1 > p .col2 :
217+ p .col1 , p .col2 = p .col2 , p .col1
218+ p .row1 , p .row2 = p .row2 , p .row1
213219
214220 def param_to_shape (self ) -> None :
215221 """Param to shape"""
0 commit comments