Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
#[throws(OE)]
fn api_wrest(form : Json<ApiPiece<ApiPieceWrest>>)
-> impl response::Responder<'static> {
+ // xxx wresting does not seem to work, maybe client isn't doing it?
api_piece_op(form)
}
impl ApiPieceOp for ApiPieceWrest {
console.log('CHECK RAISE ', dragraise, dragraise*dragraise, ddr2);
piece_set_zlevel(piece,p, (oldtop_piece) => {
let oldtop_p = pieces[oldtop_piece]!;
- let z = "42" as any; // xxx Bigfloats.add(oldtop_p.z, 1);
+ let z = wasm_bindgen.increment(oldtop_p.z);
p.z = z;
api_piece(api, "setz", piece,p, { z: z });
});
ZCoord::check_str(&get_packed_str(packed)?).e()?;
}
+#[throws(JsValue)]
+#[wasm_bindgen]
+pub fn increment(packed: &JsValue) -> JsValue {
+ let mut m = Mutable::from_str(&get_packed_str(packed)?).e()?;
+ m.increment().e()?.to_string().into()
+}
+
#[wasm_bindgen]
pub struct ZCoordIterator (zcoord::BoxedIterator);