Skip to content

Commit 016d179

Browse files
authored
Merge branch 'main' into fix/issue-lt-gt
2 parents 5a19388 + 1f79e87 commit 016d179

File tree

6 files changed

+532
-5
lines changed

6 files changed

+532
-5
lines changed

src/components/CodeEmbed/frame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ${code.css || ""}
4444
</style>
4545
<!-- If we need an addon script, load p5 the usual way with no caching to make sure
4646
the import order doesn't get messed up. -->
47-
${((code.scripts?.length ?? 0) > 0 ? [cdnLibraryUrl, ...(code.scripts ?? [])] : []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
47+
${((code.scripts?.length ?? 0) > 0 ? [(code.scripts ?? [])] : []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
4848
<body>${code.htmlBody || ""}</body>
4949
<script id="code" type="text/javascript">${wrapSketch(code.js) || ""}</script>
5050
${(code.scripts?.length ?? 0) > 0 ? '' : `

src/components/CodeEmbed/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const CodeEmbed = (props) => {
9696
base={props.base}
9797
frameRef={codeFrameRef}
9898
lazyLoad={props.lazyLoad}
99-
scripts={props.includeSound ? [cdnSoundUrl] : []}
99+
scripts={props.includeSound ? [cdnLibraryUrl, cdnSoundUrl] :[cdnLibraryUrl]}
100100
/>
101101
</div>
102102
<div className={`flex gap-2.5 ${largeSketch ? "flex-row" : "md:flex-row lg:flex-col"}`}>

src/content/tutorials/en/optimizing-webgl-sketches.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ function draw() {
457457
  loadPixels();
458458
  for (let x = 0; x < width; x += 1) {
459459
    for (let y = 0; y < height; y += 1) {
460-
      let idx = (y * height + x) * 4;
460+
      let idx = (y * width + x) * 4;
461461
      let newValue;
462462
      if (pixels[idx] + noise(x, y)*50 >= 220) {
463463
        newValue = 255;

src/content/tutorials/en/variables-and-change.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ Add a tree (or another object) to the landscape that moves vertically (up or dow
650650
triangle(25, 270, 45, 240, 70, 270);
651651
```
652652

653-
- Subtract the top angle of a triangle that draws leaves (240) by `frameCount % 290` – the value stored in `cloudOneX`:
653+
- Subtract the top angle of a triangle that draws leaves (240) by `frameCount % 290`:
654654
- Modify the value for y<sub>2</sub> in the triangle above by subtracting it by `frameCount % 290`:
655655

656656
```js

0 commit comments

Comments
 (0)