File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export type Attributes = {
13
13
'font-size' ?: string | number ;
14
14
'font-style' ?: string ;
15
15
'font-weight' ?: string | number ;
16
+ scaleX ?: number ;
17
+ scaleY ?: number ;
16
18
} ;
17
19
18
20
/** For a particular element type (e.g., rect), we will not apply certain presentation attributes. */
@@ -337,10 +339,10 @@ export class SVGContext extends RenderContext {
337
339
// handle internal scaling, am trying to make it possible
338
340
// for us to eventually move in that direction.
339
341
340
- this . state . scaleX = x ;
341
- this . state . scaleY = y ;
342
- const visibleWidth = this . width / x ;
343
- const visibleHeight = this . height / y ;
342
+ this . state . scaleX = this . state . scaleX ? this . state . scaleX * x : x ;
343
+ this . state . scaleY = this . state . scaleY ? this . state . scaleY * y : y ;
344
+ const visibleWidth = this . width / this . state . scaleX ;
345
+ const visibleHeight = this . height / this . state . scaleY ;
344
346
this . setViewBox ( 0 , 0 , visibleWidth , visibleHeight ) ;
345
347
346
348
return this ;
You can’t perform that action at this time.
0 commit comments