From: Ian Jackson Date: Tue, 16 Mar 2021 12:37:01 +0000 (+0000) Subject: ui_operations: Take IPiece, not some special snowflake X-Git-Tag: otter-0.4.0~14 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=10ab87d259214bedbc483ea2eb4b4d20d92e9518;p=otter.git ui_operations: Take IPiece, not some special snowflake Signed-off-by: Ian Jackson --- diff --git a/daemon/session.rs b/daemon/session.rs index ddc6dcff..8a8214e7 100644 --- a/daemon/session.rs +++ b/daemon/session.rs @@ -134,7 +134,7 @@ fn session_inner(form: Json, pinned: gpc.pinned, angle: vangle, desc, - uos: &pri.ui_operations(gpc, ipc.p.as_ref())?, + uos: &pri.ui_operations(gpc, ipc)?, }; let for_piece = SessionPieceContext { diff --git a/src/pcrender.rs b/src/pcrender.rs index 40185442..4a06ab4f 100644 --- a/src/pcrender.rs +++ b/src/pcrender.rs @@ -131,7 +131,7 @@ impl PieceRenderInstructions { zg : zlevel.zg, angle : pri.angle(gpc).to_compass(), pinned : gpc.pinned, - uos : pri.ui_operations(gpc, ipc.p.borrow())?, + uos : pri.ui_operations(gpc, ipc)?, } } @@ -194,7 +194,7 @@ impl PieceRenderInstructions { } #[throws(InternalError)] - pub fn ui_operations(&self, gpc: &GPiece, p: &dyn PieceTrait) + pub fn ui_operations(&self, gpc: &GPiece, ipc: &IPiece) -> Vec { let y = match self.occulted { @@ -205,7 +205,7 @@ impl PieceRenderInstructions { type WRC = WhatResponseToClientOp; let mut out = vec![]; - if p.nfaces(y) > 1 { + if ipc.p.nfaces(y) > 1 { out.push(UoDescription { wrc: WRC::UpdateSvg, kind: UoKind::Global, @@ -214,7 +214,7 @@ impl PieceRenderInstructions { desc: Html::lit("flip"), }) } - p.add_ui_operations(&mut out, gpc, y)?; + ipc.p.add_ui_operations(&mut out, gpc, y)?; out } }