Skip to content

Commit 255b570

Browse files
committed
piu resize
1 parent ecefc81 commit 255b570

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • build/devices/pebble/setup

build/devices/pebble/setup/piu.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2025 Moddable Tech, Inc.
2+
* Copyright (c) 2016-2026 Moddable Tech, Inc.
33
*
44
* This file is part of the Moddable SDK Runtime.
55
*
@@ -25,6 +25,10 @@ import Button from "pebble/button";
2525
if (!config.Screen)
2626
throw new Error("no screen configured");
2727

28+
function resize(progress) {
29+
screen.context.onResize(progress);
30+
}
31+
2832
class Screen extends config.Screen {
2933
#context;
3034
#timer;
@@ -50,6 +54,7 @@ class Screen extends config.Screen {
5054
it.onButton(state, which);
5155
}
5256
});
57+
watch.addEventListener("resize", resize);
5358
}
5459
else {
5560
if (this.#button) {
@@ -60,6 +65,7 @@ class Screen extends config.Screen {
6065
Timer.clear(this.#timer);
6166
this.#timer = undefined;
6267
}
68+
watch.removeEventListener("resize", resize);
6369
}
6470
}
6571
get rotation() {
@@ -80,7 +86,7 @@ class Screen extends config.Screen {
8086
}
8187

8288
export default function (done) {
83-
globalThis.screen = new Screen({}); // may overwrite Commodetto screen. that's oK.
89+
globalThis.screen = new Screen({}); // may overwrite Commodetto screen. that's OK.
8490

8591
done();
8692
}

0 commit comments

Comments
 (0)