Insaaf Sulaimaan
10/22/2024, 12:43 PMAlex Styl
10/22/2024, 1:07 PMInsaaf Sulaimaan
10/22/2024, 1:15 PMSkaldebane
10/22/2024, 4:46 PMInsaaf Sulaimaan
10/22/2024, 4:48 PMInsaaf Sulaimaan
10/22/2024, 4:50 PMZach Klippenstein (he/him) [MOD]
10/22/2024, 6:45 PMSkaldebane
10/22/2024, 7:05 PMIframe
(Composable) function come fromあ?? It's not built into Compose/Web, so did you make it yourself?Insaaf Sulaimaan
10/23/2024, 5:06 AMInsaaf Sulaimaan
10/23/2024, 5:06 AMAlex Styl
10/23/2024, 10:31 AM@Composable
annotation)?Insaaf Sulaimaan
10/23/2024, 11:34 AMSkaldebane
10/23/2024, 12:04 PMInsaaf Sulaimaan
10/23/2024, 12:08 PMSkaldebane
10/23/2024, 12:33 PMInsaaf Sulaimaan
10/24/2024, 4:15 AMInsaaf Sulaimaan
10/24/2024, 4:16 AMInsaaf Sulaimaan
10/24/2024, 4:21 AMSkaldebane
10/24/2024, 8:26 PM<canvas>
where Compose draws (using position: relative
) and making sure to sync up the item's position to your element's position in the Compose canvas. (you were there too :D)Skaldebane
10/24/2024, 8:32 PMSkaldebane
10/24/2024, 8:35 PMInsaaf Sulaimaan
10/25/2024, 3:53 AMInsaaf Sulaimaan
10/25/2024, 4:01 AMInsaaf Sulaimaan
10/25/2024, 4:04 AMSkaldebane
10/25/2024, 4:11 AMSkaldebane
10/25/2024, 4:14 AM<p>
elements for text for example, nor use CSS for styling.
All of that is done by Compose itself (through a rendering library called Skia), and all it wants is a place to draw its pixels.Insaaf Sulaimaan
10/25/2024, 4:23 AMSkaldebane
10/25/2024, 7:52 AM<canvas>
HTML element, which provides a JavaScript API to draw into it (as well as using WebGL; which is what Skia does).
That's where Compose draws its pixels (through Skia).
Don't overthink Skia too much, it's just a rendering detail. All you should understand is that Compose doesn't rely on the browser for rendering, it's all custom rendering, into a single <canvas>
element it places in the body of the HTML template that holds your page. This is the reason there are still issues with zoom etc... Compose has to handle all of that manually.
You can open developer tools and you'll find the canvas element in the HTML node tree.Skaldebane
10/25/2024, 7:54 AM<canvas>
2. Put it below the <canvas>
, and make a "transparent" hole in the canvas for it to appear.
All while synchronizing its size, position, and rotation to a corresponding node in Compose.Skaldebane
10/25/2024, 7:56 AMInsaaf Sulaimaan
10/25/2024, 10:02 AMInsaaf Sulaimaan
10/25/2024, 10:17 AMSkaldebane
10/25/2024, 10:18 AMInsaaf Sulaimaan
10/25/2024, 10:19 AM