-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw rect fill #5
base: master
Are you sure you want to change the base?
Conversation
After rebasing against recent master changes, running `cargo test` elicits the following error: ❯ cargo test -- --test-threads=1 --nocapture Compiling libm v0.2.8 Compiling num-traits v0.2.17 Compiling getrandom v0.2.12 Compiling strum_macros v0.26.1 Compiling castaway v0.2.2 Compiling static_assertions v1.1.0 Compiling ppv-lite86 v0.2.17 Compiling itoa v1.0.10 Compiling ryu v1.0.16 Compiling rand_core v0.6.4 Compiling compact_str v0.7.1 Compiling rand_xorshift v0.3.0 Compiling rand_chacha v0.3.1 Compiling rand v0.8.5 Compiling image v0.24.8 Compiling chrono v0.4.33 Compiling rand_distr v0.4.3 Compiling strum v0.26.1 Compiling ratatui v0.26.0 Compiling flexi_logger v0.27.4 Compiling plotters-bitmap v0.3.3 Compiling plotters v0.3.5 Compiling plotters-ratatui-backend v0.1.3 (/home/ebardie/src/bytecounter/plotters-ratatui-backend) error[E0601]: `main` function not found in crate `boilerplate` --> plotters-ratatui-backend/examples/boilerplate.rs:54:2 | 54 | } | ^ consider adding a `main` function to `plotters-ratatui-backend/examples/boilerplate.rs` For more information about this error, try `rustc --explain E0601`. error: could not compile `plotters-ratatui-backend` (example "boilerplate") due to 1 previous error warning: build failed, waiting for other jobs to finish... This commit adds a dummy main to `examples/boilerplate.rs`, which keeps `cargo` happy.
At this point the tests of fill functionality will and ought to fail. The test cases are bundled in to an array which is passed to a single test function. It may be preferrable to make use of a testing crate, e.g rstest, and to split out each test in to a separate test, but see https://github.com/ratatui-org/ratatui/blob/359204c9298cc26ea21807d886d596de0329bacc/tests/widgets_chart.rs#L66 for an alternative approach from the exemplar of buffer testing.f
Terminal chars have two distinct dimensions (2, 4), not the previous used unitary (4).
tbh I would still prefer to implement this by reusing ratatui/ratatui#919 and ratatui/ratatui#920 instead, but it appears that the PRs are blocked due to unclear concerns on the algorithm in ratatui/ratatui#917. |
I appreciate your preference. This reworking gets me a solution now and was useful learning for me :) I can pin my application against my version of p-r-b in git using You should still take a look at the individual commits in my PR. 864d458 addresses a real bug in p-r-b. Having some tests in p-r-b would be good. Not that I'm assuming my tests are how you'd want to implement them, there being various ways the tests could be implemented, and you may prefer a different way for p-r-b. See: fa07606 |
Here's a newer version of my previous PR with just a fill implementation added for
draw_rect
, i.e notfor draw_circle
but it does include proper render buffer based tests fordraw_rect
, and fixes a couple of other issues too.I've left the older PR up for reference for now, but will delete it soon.