@@ -151,11 +151,18 @@ function drawOptimizedControlIcon({
151151 return icon ;
152152}
153153
154+ function getControlIconSize ( ) : number {
155+ if ( FOUNDRY_API . generation < 13 ) {
156+ return Math . max ( Math . round ( ( canvas . dimensions . size * 0.5 ) / 20 ) * 20 , 40 ) ;
157+ }
158+ return 60 * canvas . dimensions . uiScale ;
159+ }
160+
154161function AmbientLight__draw ( this : AmbientLight , wrapped : ( ...args : any [ ] ) => void , ...args : any [ ] ) {
155162 const result = wrapped ( ...args ) ;
156163 removeOldControlIcon ( this ) ;
157164
158- const size = 60 * canvas . dimensions . uiScale ;
165+ const size = getControlIconSize ( ) ;
159166 this . controlIcon = this . addChild ( drawOptimizedControlIcon ( { size, texture : CONFIG . controlIcons . light } ) ) ;
160167
161168 return result ;
@@ -165,7 +172,7 @@ function AmbientSound__draw(this: AmbientSound, wrapped: (...args: any[]) => voi
165172 const result = wrapped ( ...args ) ;
166173 removeOldControlIcon ( this ) ;
167174
168- const size = 60 * canvas . dimensions . uiScale ;
175+ const size = getControlIconSize ( ) ;
169176 this . controlIcon = this . addChild ( drawOptimizedControlIcon ( { size, texture : CONFIG . controlIcons . sound } ) ) ;
170177
171178 return result ;
@@ -175,7 +182,7 @@ function MeasuredTemplate__draw(this: MeasuredTemplate, wrapped: (...args: any[]
175182 const result = wrapped ( ...args ) ;
176183 removeOldControlIcon ( this ) ;
177184
178- const size = 60 * canvas . dimensions . uiScale ;
185+ const size = getControlIconSize ( ) ;
179186 this . controlIcon = this . addChild ( drawOptimizedControlIcon ( { size, texture : CONFIG . controlIcons . template } ) ) ;
180187
181188 return result ;
0 commit comments