mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix issue #81
background clears were going beyond their borders, and also introducing a new border of their own. fixed.
This commit is contained in:
parent
5706c9e525
commit
4d3a8c2ced
1 changed files with 6 additions and 3 deletions
|
|
@ -349,6 +349,7 @@ impl<'a> Modal<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn redraw(&mut self) {
|
pub fn redraw(&mut self) {
|
||||||
|
const BORDER_WIDTH: i16 = 3;
|
||||||
log::debug!("modal redraw");
|
log::debug!("modal redraw");
|
||||||
let canvas_size = self.gam.get_canvas_bounds(self.canvas).unwrap();
|
let canvas_size = self.gam.get_canvas_bounds(self.canvas).unwrap();
|
||||||
let do_redraw = self.top_dirty || self.bot_dirty;
|
let do_redraw = self.top_dirty || self.bot_dirty;
|
||||||
|
|
@ -357,7 +358,7 @@ impl<'a> Modal<'a> {
|
||||||
self.gam.draw_rounded_rectangle(self.canvas,
|
self.gam.draw_rounded_rectangle(self.canvas,
|
||||||
RoundedRectangle::new(
|
RoundedRectangle::new(
|
||||||
Rectangle::new_with_style(Point::new(0, 0), canvas_size,
|
Rectangle::new_with_style(Point::new(0, 0), canvas_size,
|
||||||
DrawStyle::new(if self.inverted{PixelColor::Dark} else {PixelColor::Light}, PixelColor::Dark, 3)
|
DrawStyle::new(if self.inverted{PixelColor::Dark} else {PixelColor::Light}, PixelColor::Dark, BORDER_WIDTH)
|
||||||
), 5
|
), 5
|
||||||
)).unwrap();
|
)).unwrap();
|
||||||
}
|
}
|
||||||
|
|
@ -393,8 +394,10 @@ impl<'a> Modal<'a> {
|
||||||
if !do_redraw {
|
if !do_redraw {
|
||||||
// the action area wasn't blanked, so blank it as prep for the action redraw
|
// the action area wasn't blanked, so blank it as prep for the action redraw
|
||||||
self.gam.draw_rectangle(self.canvas,
|
self.gam.draw_rectangle(self.canvas,
|
||||||
Rectangle::new_with_style(Point::new(0, cur_height), Point::new(canvas_size.x, cur_height + action_height),
|
Rectangle::new_with_style(Point::new(BORDER_WIDTH, cur_height), Point::new(canvas_size.x - BORDER_WIDTH, cur_height + action_height),
|
||||||
DrawStyle::new(if self.inverted{PixelColor::Dark} else {PixelColor::Light}, PixelColor::Dark, 2)
|
DrawStyle::new(
|
||||||
|
if self.inverted{PixelColor::Dark} else {PixelColor::Light},
|
||||||
|
if self.inverted{PixelColor::Dark} else {PixelColor::Light}, 0)
|
||||||
)).unwrap();
|
)).unwrap();
|
||||||
}
|
}
|
||||||
self.action.redraw(cur_height, &self);
|
self.action.redraw(cur_height, &self);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue