@@ -101,22 +101,23 @@ suite('Rendering', function() {
101
101
assert . equal ( fbo . height , 15 ) ;
102
102
} ) ;
103
103
104
- // NOTE: below two are nearly identical, should be checked
105
- test ( 'should resize the dimensions of canvas based on max texture size' , function ( ) {
104
+ test ( 'should limit dimensions of canvas based on max texture size on create' , function ( ) {
106
105
glStub = vi . spyOn ( p5 . RendererGL . prototype , '_getMaxTextureSize' ) ;
107
106
const fakeMaxTextureSize = 100 ;
108
107
glStub . mockReturnValue ( fakeMaxTextureSize ) ;
109
108
myp5 . createCanvas ( 10 , 10 , myp5 . WEBGL ) ;
109
+ myp5 . pixelDensity ( 1 ) ;
110
110
myp5 . resizeCanvas ( 200 , 200 ) ;
111
111
assert . equal ( myp5 . width , 100 ) ;
112
112
assert . equal ( myp5 . height , 100 ) ;
113
113
} ) ;
114
114
115
- test . todo ( 'should resize the dimensions of canvas based on max texture size' , function ( ) {
115
+ test ( 'should limit dimensions of canvas based on max texture size on resize ' , function ( ) {
116
116
glStub = vi . spyOn ( p5 . RendererGL . prototype , '_getMaxTextureSize' ) ;
117
117
const fakeMaxTextureSize = 100 ;
118
118
glStub . mockReturnValue ( fakeMaxTextureSize ) ;
119
119
myp5 . createCanvas ( 200 , 200 , myp5 . WEBGL ) ;
120
+ myp5 . pixelDensity ( 1 ) ;
120
121
assert . equal ( myp5 . width , 100 ) ;
121
122
assert . equal ( myp5 . height , 100 ) ;
122
123
} ) ;
0 commit comments