Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory Support work #99

Merged
merged 13 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 8569b2 to c748d9
5 changes: 3 additions & 2 deletions examples/src/fireworks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused_imports)]
use pax_lang::api::{ArgsClick, ArgsWheel, EasingCurve, NodeContext};
use pax_lang::*;
use pax_std::primitives::{Ellipse, Frame, Group, Path, Rectangle, Text};
Expand All @@ -13,13 +14,13 @@ pub struct Fireworks {
const ROTATION_COEFFICIENT: f64 = 0.00010;

impl Fireworks {
pub fn handle_scroll(&mut self, ctx: &NodeContext, args: ArgsWheel) {
pub fn handle_scroll(&mut self, _ctx: &NodeContext, args: ArgsWheel) {
let old_t = self.rotation.get();
let new_t = old_t - args.delta_y * ROTATION_COEFFICIENT;
self.rotation.set(f64::max(0.0, new_t));
}

pub fn handle_pre_render(&mut self, ctx: &NodeContext) {
pub fn handle_pre_render(&mut self, _ctx: &NodeContext) {
let old_ticks = self.ticks.get();
self.ticks.set(old_ticks + 1);
}
Expand Down
2 changes: 1 addition & 1 deletion pax-chassis-web/interface/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function loadWasmModule(extensionlessUrl: string): Promise<{ chassis: PaxC

const wasmBinary = await fetch(`${extensionlessUrl}_bg.wasm`);
const wasmArrayBuffer = await wasmBinary.arrayBuffer();
let _io = glueCodeModule.initSync(wasmArrayBuffer);
let _io = await glueCodeModule.default(wasmArrayBuffer);

let chassis = glueCodeModule.PaxChassisWeb.new();
let get_latest_memory = glueCodeModule.wasm_memory;
Expand Down
2 changes: 1 addition & 1 deletion pax-chassis-web/interface/src/types/pax-chassis-web.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ export function initSync(module: SyncInitInput): InitOutput;
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading
Loading