File tree Expand file tree Collapse file tree
packages/instrument-library/src/interactive/breakout-task Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ import { z } from '/runtime/v1/zod@3.23.x';
33
44import './styles.css' ;
55
6- const baseHeight = 320 ;
7- const baseWidth = 480 ;
6+ const BASE_HEIGHT = 320 ;
7+ const BASE_WIDTH = 480 ;
88
99function getScale ( ) {
1010 const ratios = [ 1 , 1.25 , 1.5 , 2 ] ;
1111 for ( let i = 1 ; i < ratios . length ; i ++ ) {
1212 const multiplier = ratios [ i ] ! + 0.25 ;
13- const [ heightThreshold , widthThreshold ] = [ baseHeight * multiplier , baseWidth * multiplier ] ;
13+ const [ heightThreshold , widthThreshold ] = [ BASE_HEIGHT * multiplier , BASE_WIDTH * multiplier ] ;
1414 if ( window . innerHeight < heightThreshold || window . innerWidth < widthThreshold ) {
1515 return ratios [ i - 1 ] ! ;
1616 }
@@ -34,8 +34,8 @@ export default defineInstrument({
3434
3535 const canvas = document . createElement ( 'canvas' ) ;
3636
37- const height = baseHeight * scale ;
38- const width = baseWidth * scale ;
37+ const height = BASE_HEIGHT * scale ;
38+ const width = BASE_WIDTH * scale ;
3939
4040 canvas . width = width * ratio ;
4141 canvas . height = height * ratio ;
You can’t perform that action at this time.
0 commit comments