File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ export class Pannable extends Etch {
79
79
80
80
this . isLoaded = false
81
81
82
- // force update, so readAfterUpdate gets executed
83
- this . update ( )
84
82
if ( item && item . nodeName && item . nodeName . toLowerCase ( ) === 'img' ) {
85
83
item . onload = ( ) => {
86
84
etch . update ( this ) . then ( ( ) => {
@@ -92,16 +90,12 @@ export class Pannable extends Etch {
92
90
} else {
93
91
this . isLoaded = true
94
92
}
95
- this . update ( )
93
+ etch . update ( this )
96
94
}
97
95
98
96
readAfterUpdate ( ) {
99
97
this . innerContainerRect = this . refs . innerContainer . getBoundingClientRect ( )
100
98
this . outerContainerRect = this . refs . outerContainer . getBoundingClientRect ( )
101
-
102
- this . setInitialScale ( this . item )
103
-
104
- etch . update ( this )
105
99
}
106
100
107
101
setInitialScale ( item ) {
@@ -117,18 +111,20 @@ export class Pannable extends Etch {
117
111
}
118
112
119
113
resetAll ( ) {
114
+ this . setInitialScale ( this . item )
120
115
this . scale = this . initialScale
121
116
this . left = 0
122
117
this . top = 0
123
- this . update ( )
118
+
119
+ etch . update ( this )
124
120
}
125
121
126
122
ondrag ( { movementX, movementY} ) {
127
123
if ( ! this . dragging ) return ;
128
124
129
125
this . left += movementX
130
126
this . top += movementY
131
- this . update ( ) ;
127
+ etch . update ( this ) ;
132
128
}
133
129
134
130
zoom ( e , amount ) {
@@ -151,7 +147,7 @@ export class Pannable extends Etch {
151
147
this . left -= x * zoom - x
152
148
this . top -= y * zoom - y
153
149
}
154
- this . update ( ) ;
150
+ etch . update ( this ) ;
155
151
}
156
152
157
153
toolbarView ( ) {
You can’t perform that action at this time.
0 commit comments