chiark / gitweb /
ui_operations: Take IPiece, not some special snowflake
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Mar 2021 12:37:01 +0000 (12:37 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Mar 2021 12:37:01 +0000 (12:37 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/session.rs
src/pcrender.rs

index ddc6dcfff8fadb566f2b76b20824c7244e89231f..8a8214e74d41c0c38666ebafe4250e235e0fedfe 100644 (file)
@@ -134,7 +134,7 @@ fn session_inner(form: Json<SessionForm>,
         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 {
index 401854426ca1dd85ed5e9e8440ec285e64becfd6..4a06ab4f81660ab4e2c616532c05969be084094e 100644 (file)
@@ -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<UoDescription>
   {
     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
   }
 }