Skip to content

Commit

Permalink
wip labels
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Jan 31, 2024
1 parent 6b46819 commit 9a1de1e
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions examples/webgpu_multiple_canvases.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@
row-gap: 10px;
}

#container canvas {
#container > div {
position: relative;
border: 1px solid white;
}

canvas {
width: 200px;
height: 200px;
border: 1px solid white;
}

.label {
position: absolute;
color: white;
bottom: 0;
}
</style>
</head>
Expand Down Expand Up @@ -107,7 +117,17 @@

const domElement = canvasRenderTarget.domElement;

container.appendChild( domElement );
const frame = document.createElement( 'div' );
const label = document.createElement( 'div' );

label.innerText = 'color space ' + ( canvasRenderTarget.outputColorSpace || 'none' ) + ( canvasRenderTarget.antialias ? ' antialias' : '' );
label.classList.add( 'label' );

frame.appendChild( label );
frame.appendChild( domElement );

container.appendChild( frame );

observer.observe( domElement );

canvasRenderTarget.setPixelRatio( window.devicePixelRatio );
Expand Down

0 comments on commit 9a1de1e

Please sign in to comment.