[rust] fix examples

This commit is contained in:
joseLuís 2021-06-07 20:55:45 +02:00
parent 0d7b6619bb
commit 5d4ee0f294
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ fn main() -> NcResult<()> {
assert_eq![(t_rows, t_cols), stdplane.dim_yx()];
// set the standard plane's base cell's foreground and background colors
let channels = NcChannelPair::with_rgb(0x88aa00, 0x2222288);
let channels = NcChannelPair::with_rgb(0x88aa00, 0x222288);
stdplane.set_base("x", 0, channels)?;
rsleep![&mut nc, 0, 500];

View File

@ -8,17 +8,17 @@ fn main() -> NcResult<()> {
// FIXME: this doesn't show at all :/
let plane1 = NcPlane::new(&mut nc, 0, 0, 20, 40)?;
plane1.set_base("·", 0, chan_green)?;
plane1.set_base("1", 0, chan_green)?;
let plane2 = NcPlane::new_bound(plane1, 0, 0, 2, 4)?;
plane2.set_base("·", 0, chan_blue)?;
plane2.set_base("2", 0, chan_blue)?;
plane1.render()?;
plane1.rasterize()?;
rsleep![&mut nc, 2];
// but the stdplane does show
nc.stdplane().set_base("x", 0, chan_blue)?;
nc.stdplane().set_base("s", 0, chan_blue)?;
let substdplane = NcPlane::new_bound(nc.stdplane(), 5, 10, 10, 20)?;
substdplane.set_base("~", 0, chan_green)?;
substdplane.set_base("u", 0, chan_green)?;
rsleep![&mut nc, 2];
nc.stop()?;