File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ Called at the start of the WebGL frame.
9999### ` gl-error(reason) `
100100Called if there was an error initializing webgl
101101
102- ### ` resize(width, height) `
102+ ### ` gl- resize(width, height)`
103103Called when the WebGL window is resized
104104
105105
Original file line number Diff line number Diff line change @@ -85,13 +85,14 @@ function createGLShell(options) {
8585 shell . emit ( "gl-init" )
8686 } )
8787
88-
89-
9088 function resize ( ) {
91- shell . canvas . width = ( shell . _width / scale ) | 0
92- shell . canvas . height = ( shell . _height / scale ) | 0
89+ var nw = ( shell . _width / scale ) | 0
90+ var nh = ( shell . _height / scale ) | 0
91+ shell . canvas . width = nw
92+ shell . canvas . height = nh
9393 shell . canvas . style . width = shell . _width + 'px'
9494 shell . canvas . style . height = shell . _height + 'px'
95+ shell . emit ( "gl-resize" , nw , nh )
9596 }
9697
9798 Object . defineProperty ( shell , 'scale' , {
You can’t perform that action at this time.
0 commit comments