Skip to content

Commit

Permalink
fix canvas selector in pyo emu, ignore .DS_Store
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Mar 5, 2024
1 parent a9555b3 commit 8e6ee17
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion scripts/build-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ then

# TODO: test -sWEBGL2_BACKWARDS_COMPATIBILITY_EMULATION

LDFLAGS="-sUSE_GLFW=3 -sUSE_WEBGL2 -sMIN_WEBGL_VERSION=2 -sOFFSCREENCANVAS_SUPPORT=1 -sFULL_ES2 -sFULL_ES3"
# -sUSE_WEBGL2 -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2

LDFLAGS="-sUSE_GLFW=3 -sOFFSCREENCANVAS_SUPPORT=1 -sFULL_ES2 -sFULL_ES3"

LDFLAGS="$LDFLAGS -lsqlite3"

Expand Down
3 changes: 2 additions & 1 deletion src/pygbag/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/.github
/.vscode
/.idea
/.DS_Store
/dist
/build
/venv
Expand All @@ -26,7 +27,7 @@
"\n"
)

SKIP_EXT = ["pyc", "pyx", "pyd", "pyi", "exe", "log", "blend", "DS_Store"]
SKIP_EXT = ["pyc", "pyx", "pyd", "pyi", "exe", "bak", "log", "blend", "DS_Store"]


def filter(walked):
Expand Down
2 changes: 1 addition & 1 deletion src/pygbag/support/pyodide.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class m_pyodide:

class m_canvas:
def getCanvas3D(self, name='canvas',width=1024,height=1024):
canvas = platform.document.getElementById("canvas")
canvas = platform.document.getElementById(name)
canvas.width = width
canvas.height = height
return canvas
Expand Down
4 changes: 3 additions & 1 deletion static/pythons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1576,10 +1576,12 @@ MM.unpause = function unpause(trackid) {
}

MM.set_volume = function set_volume(trackid, vol) {
console.log(`MM.set_volume track=${trackid} vol=${vol}`)
MM[trackid].media.volume = 1 * vol
}

MM.set_volume = function get_volume(trackid, vol) {
MM.get_volume = function get_volume(trackid, vol) {
console.log(`MM.get_volume track=${trackid} vol=${vol}`)
return MM[trackid].media.volume
}

Expand Down

0 comments on commit 8e6ee17

Please sign in to comment.