Skip to content

Commit

Permalink
fix(scrcpy): incorrect scroll controller in version 1.22 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Dec 10, 2024
1 parent 6140ebc commit 7f2a09c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-elephants-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@yume-chan/scrcpy": patch
---

Fix incorrect scroll controller in version 1.22 and later
2 changes: 1 addition & 1 deletion libraries/pcm-player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@types/audioworklet": "^0.0.65",
"@types/audioworklet": "^0.0.64",
"@yume-chan/eslint-config": "workspace:^",
"@yume-chan/tsconfig": "workspace:^",
"prettier": "^3.4.2",
Expand Down
1 change: 1 addition & 0 deletions libraries/scrcpy/src/1_22/impl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { Defaults } from "./defaults.js";
export type { Init } from "./init.js";
export { parseVideoStreamMetadata } from "./parse-video-stream-metadata.js";
export {
createScrollController,
InjectScrollControlMessage,
ScrollController,
} from "./scroll-controller.js";
5 changes: 5 additions & 0 deletions libraries/scrcpy/src/1_22/impl/scroll-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { s32, struct } from "@yume-chan/struct";

import type { ScrcpyInjectScrollControlMessage } from "../../latest.js";

import type { ScrcpyScrollController } from "../../base/index.js";
import { PrevImpl } from "./prev.js";

export const InjectScrollControlMessage = /* #__PURE__ */ (() =>
Expand Down Expand Up @@ -30,3 +31,7 @@ export class ScrollController extends PrevImpl.ScrollController {
return InjectScrollControlMessage.serialize(processed);
}
}

export function createScrollController(): ScrcpyScrollController {
return new ScrollController();
}
1 change: 1 addition & 0 deletions libraries/scrcpy/src/1_25/impl/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "../../1_24/impl/index.js";
export {
createScrollController,
InjectScrollControlMessage,
ScrollController,
SignedFloat,
Expand Down
6 changes: 5 additions & 1 deletion libraries/scrcpy/src/1_25/impl/scroll-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { getInt16, setInt16 } from "@yume-chan/no-data-view";
import type { Field, StructInit } from "@yume-chan/struct";
import { bipedal, struct, u16, u32, u8 } from "@yume-chan/struct";

import { ScrcpyControlMessageType } from "../../base/index.js";
import type { ScrcpyScrollController } from "../../base/index.js";
import { ScrcpyControlMessageType } from "../../base/index.js";
import type { ScrcpyInjectScrollControlMessage } from "../../latest.js";
import { clamp } from "../../utils/index.js";

Expand Down Expand Up @@ -49,3 +49,7 @@ export class ScrollController implements ScrcpyScrollController {
return InjectScrollControlMessage.serialize(message);
}
}

export function createScrollController(): ScrcpyScrollController {
return new ScrollController();
}
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7f2a09c

Please sign in to comment.