Skip to content

Commit

Permalink
autoresize initialization fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cxreiff committed Aug 7, 2024
1 parent b0b4f69 commit 5268376
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 29 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/check.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() {
RatatuiRenderPlugin::new("main", (1, 1))
.print_full_terminal()
.autoresize()
.autoresize_conversion_fn(|(width, height)| (width * 16, height * 9)),
.autoresize_conversion_fn(|(width, height)| (width * 4, height * 3)),
))
.insert_resource(ClearColor(Color::BLACK))
.add_systems(Startup, setup_scene_system)
Expand Down
15 changes: 11 additions & 4 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,18 @@ impl Plugin for RatatuiRenderPlugin {
}

if self.autoresize {
app.add_systems(PostStartup, initial_resize_system)
.add_systems(
PostUpdate,
app.add_systems(
PostStartup,
(
initial_resize_system,
autoresize_system_generator(self.id.clone(), self.autoresize_conversion_fn),
);
)
.chain(),
)
.add_systems(
PostUpdate,
autoresize_system_generator(self.id.clone(), self.autoresize_conversion_fn),
);
}
}

Expand Down

0 comments on commit 5268376

Please sign in to comment.