@@ -35,8 +35,6 @@ let canvasMouseClicked = false;
35
35
const pressedKeys = new Set <string >();
36
36
37
37
const canvas = useTemplateRef (" canvas" );
38
- const canvasWidth = ref (0 );
39
- const canvasHeight = ref (0 );
40
38
const frameTime = ref (0 );
41
39
const frameID = ref (0 );
42
40
const fps = ref (0 );
@@ -86,12 +84,6 @@ onMounted(() => {
86
84
87
85
window .addEventListener (' keydown' , handleKeyDown );
88
86
window .addEventListener (' keyup' , handleKeyUp );
89
-
90
- // initialize reported canvas size
91
- if (canvas .value ) {
92
- canvasWidth .value = canvas .value .width ;
93
- canvasHeight .value = canvas .value .height ;
94
- }
95
87
})
96
88
97
89
/**
@@ -292,10 +284,6 @@ function resizeCanvasHandler(entries: ResizeObserverEntry[]) {
292
284
let needResize = resizeCanvas (entries );
293
285
if (needResize ) {
294
286
handleResize ();
295
- if (canvas .value ) {
296
- canvasWidth .value = canvas .value .width ;
297
- canvasHeight .value = canvas .value .height ;
298
- }
299
287
}
300
288
}
301
289
@@ -957,12 +945,12 @@ function onRun(runCompiledCode: CompiledPlayground) {
957
945
<button @click =" setFrame(frameID - 1)" title =" Step backward" >⏴ ; </button >
958
946
<button @click =" setFrame(frameID + 1)" title =" Step forward" >⏵ ; </button >
959
947
<button @click =" pauseRender = !pauseRender" :title =" pauseRender ? 'Resume' : 'Pause'" >⏯</button >
960
- <span class =" frame-counter" >Frame: {{ frameID }}</span >
961
- <span class =" perf-info" >{{ frameTime.toFixed(1) }} ms</span >
962
- <span class =" fps-counter" >FPS: {{ fps }}</span >
963
- <span class =" fps-counter" >FPS: {{ Math.round(1000 / frameTime) }}</span >
948
+ <span class =" frame-counter" >{{ String(frameID).padStart(5, '0') }}</span >
964
949
</div >
965
950
<div class =" controls-right" >
951
+ <span >{{ frameTime.toFixed(1) }} ms</span >
952
+ <span >{{ Math.min(Math.round(1000 / frameTime), 60) }} fps</span >
953
+ <span >{{ canvas?.width }}x{{ canvas?.height }}</span >
966
954
<button @click =" toggleFullscreen" title =" Toggle full screen" >⛶ ; </button >
967
955
</div >
968
956
</div >
@@ -981,14 +969,17 @@ function onRun(runCompiledCode: CompiledPlayground) {
981
969
bottom : 0 ;
982
970
left : 0 ;
983
971
right : 0 ;
984
- height : 32 px ;
972
+ height : 36 px ;
985
973
padding : 4px 8px ;
986
974
background : rgba (0 , 0 , 0 , 0.5 );
987
975
display : flex ;
988
976
align-items : center ;
989
977
justify-content : space-between ;
990
978
color : white ;
991
979
font-size : 14px ;
980
+ overflow : hidden ;
981
+ white-space : nowrap ;
982
+ width : 100% ;
992
983
}
993
984
.control-bar .controls-left > * {
994
985
margin-right : 8px ;
0 commit comments