File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -386,11 +386,16 @@ def anchored_position(self):
386386 if self ._anchor_point is None :
387387 return None
388388 return (
389- int (self .x + (self ._anchor_point [0 ] * self ._boundingbox [2 ] * self ._scale )),
390389 int (
391- self .y
392- + (self ._anchor_point [1 ] * self ._boundingbox [3 ] * self ._scale )
393- - round ((self ._boundingbox [3 ] * self ._scale ) / 2.0 )
390+ self .x
391+ + round (self ._anchor_point [0 ] * self ._boundingbox [2 ] * self ._scale )
392+ ),
393+ int (
394+ round (
395+ self .y
396+ + (self ._anchor_point [1 ] * self ._boundingbox [3 ] * self ._scale )
397+ - ((self ._boundingbox [3 ] * self ._scale ) / 2.0 )
398+ )
394399 ),
395400 )
396401
@@ -400,12 +405,14 @@ def anchored_position(self, new_position):
400405 return # Note: anchor_point must be set before setting anchored_position
401406 new_x = int (
402407 new_position [0 ]
403- - self ._anchor_point [0 ] * (self ._boundingbox [2 ] * self ._scale )
408+ - round ( self ._anchor_point [0 ] * (self ._boundingbox [2 ] * self ._scale ) )
404409 )
405410 new_y = int (
406- new_position [1 ]
407- - (self ._anchor_point [1 ] * self ._boundingbox [3 ] * self ._scale )
408- + round ((self ._boundingbox [3 ] * self ._scale ) / 2.0 )
411+ round (
412+ new_position [1 ]
413+ - (self ._anchor_point [1 ] * self ._boundingbox [3 ] * self ._scale )
414+ + ((self ._boundingbox [3 ] * self ._scale ) / 2.0 )
415+ )
409416 )
410417 self .x = new_x
411418 self .y = new_y
You can’t perform that action at this time.
0 commit comments