Skip to content

Commit

Permalink
Implement __deepcopy__ and __copy__ for perf
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Jun 20, 2024
1 parent c3e2c16 commit cbb1377
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cairo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ where

/// The base class for Manim.Camera with --renderer=cairo
#[pyclass(subclass)]
#[derive(Clone)]
pub struct CairoCamera;

#[pymethods]
Expand Down Expand Up @@ -108,7 +109,11 @@ impl CairoCamera {
Ok(())
}

pub fn __getstate__(&self, py: Python<'_>) -> PyObject {
().to_object(py)
pub fn __copy__(&self) -> Self {
self.clone()
}

pub fn __deepcopy__(&self, _memo: Py<PyAny>) -> Self {
self.clone()
}
}

0 comments on commit cbb1377

Please sign in to comment.