File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ def __init__(
79
79
padding_right = 0 ,
80
80
** kwargs
81
81
):
82
+ if "scale" in kwargs .keys ():
83
+ self ._scale = kwargs ["scale" ]
84
+ else :
85
+ self ._scale = 1
82
86
if not max_glyphs and not text :
83
87
raise RuntimeError ("Please provide a max size, or initial text" )
84
88
if not max_glyphs :
@@ -361,13 +365,15 @@ def anchored_position(self):
361
365
362
366
@anchored_position .setter
363
367
def anchored_position (self , new_position ):
364
- self . x = int (
368
+ new_x = int (
365
369
new_position [0 ]
366
- - self ._boundingbox [0 ]
367
- - self ._anchor_point [0 ] * self ._boundingbox [2 ]
370
+ - self ._anchor_point [0 ] * (self ._boundingbox [2 ] * self ._scale )
368
371
)
369
- self .y = int (
372
+ new_y = self .y = int (
370
373
new_position [1 ]
371
- - self ._boundingbox [1 ]
372
- - self ._anchor_point [ 1 ] * self ._boundingbox [ 3 ]
374
+ - self ._anchor_point [1 ] * ( self . _boundingbox [ 3 ] * self . _scale )
375
+ + ( self ._boundingbox [ 3 ] * self ._scale ) / 2
373
376
)
377
+ self ._boundingbox = (new_x , new_y , self ._boundingbox [2 ], self ._boundingbox [3 ])
378
+ self .x = new_x
379
+ self .y = new_y
You can’t perform that action at this time.
0 commit comments