diff --git a/pixlib_parser/src/runner/classes/animation.rs b/pixlib_parser/src/runner/classes/animation.rs
index 60321e1..3712072 100644
--- a/pixlib_parser/src/runner/classes/animation.rs
+++ b/pixlib_parser/src/runner/classes/animation.rs
@@ -214,16 +214,25 @@ impl Animation {
pub fn get_frame_position(&self) -> anyhow::Result<(isize, isize)> {
let context = RunnerContext::new_minimal(&self.parent.parent.runner, &self.parent);
+ self.state
+ .borrow_mut()
+ .use_and_drop_mut(|s| s.load_if_needed(context.clone()))?;
self.state.borrow().get_frame_position(context)
}
pub fn get_frame_size(&self) -> anyhow::Result<(usize, usize)> {
let context = RunnerContext::new_minimal(&self.parent.parent.runner, &self.parent);
+ self.state
+ .borrow_mut()
+ .use_and_drop_mut(|s| s.load_if_needed(context.clone()))?;
self.state.borrow().get_frame_size(context)
}
pub fn get_center_frame_position(&self) -> anyhow::Result<(isize, isize)> {
let context = RunnerContext::new_minimal(&self.parent.parent.runner, &self.parent);
+ self.state
+ .borrow_mut()
+ .use_and_drop_mut(|s| s.load_if_needed(context.clone()))?;
self.state.borrow().get_center_frame_position(context)
}
@@ -245,6 +254,9 @@ impl Animation {
) -> anyhow::Result