File tree 1 file changed +15
-8
lines changed
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):
386
386
if self ._anchor_point is None :
387
387
return None
388
388
return (
389
- int (self .x + (self ._anchor_point [0 ] * self ._boundingbox [2 ] * self ._scale )),
390
389
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
+ )
394
399
),
395
400
)
396
401
@@ -400,12 +405,14 @@ def anchored_position(self, new_position):
400
405
return # Note: anchor_point must be set before setting anchored_position
401
406
new_x = int (
402
407
new_position [0 ]
403
- - self ._anchor_point [0 ] * (self ._boundingbox [2 ] * self ._scale )
408
+ - round ( self ._anchor_point [0 ] * (self ._boundingbox [2 ] * self ._scale ) )
404
409
)
405
410
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
+ )
409
416
)
410
417
self .x = new_x
411
418
self .y = new_y
You can’t perform that action at this time.
0 commit comments