File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import ToolHandler from "../handlers/Tool.js";
6
6
export default class {
7
7
constructor ( view ) {
8
8
this . view = view ;
9
- let computedStyle = getComputedStyle ( this . view ) ;
9
+ let boundingRect = view . getBoundingClientRect ( ) ;
10
10
this . view . style . setProperty ( "stroke-linecap" , "round" ) ;
11
11
this . view . style . setProperty ( "stroke-linejoin" , "round" ) ;
12
- this . view . setAttribute ( "viewBox" , `0 0 ${ parseInt ( computedStyle . width ) } ${ parseInt ( computedStyle . height ) } ` ) ;
12
+ this . view . setAttribute ( "viewBox" , `0 0 ${ boundingRect . width } ${ boundingRect . height } ` ) ;
13
13
14
14
this . layers . create ( ) ;
15
15
@@ -19,8 +19,7 @@ export default class {
19
19
this . mouse . on ( "up" , this . clip . bind ( this ) ) ;
20
20
21
21
window . addEventListener ( "resize" , this . resize . bind ( this ) ) ;
22
-
23
- document . addEventListener ( "keydown" , this . keyDown . bind ( this ) ) ;
22
+ document . addEventListener ( "keydown" , this . keydown . bind ( this ) ) ;
24
23
}
25
24
zoom = 1 ;
26
25
zoomIncrementValue = 0.5 ;
@@ -331,7 +330,7 @@ export default class {
331
330
}
332
331
}
333
332
334
- keyDown ( event ) {
333
+ keydown ( event ) {
335
334
event . preventDefault ( ) ;
336
335
event . stopPropagation ( ) ;
337
336
switch ( event . key ) {
You can’t perform that action at this time.
0 commit comments