added one more thing tot he UIPatternModel
This commit is contained in:
parent
0e8895b3ad
commit
8f655eda7f
1 changed files with 10 additions and 0 deletions
|
@ -227,6 +227,16 @@ impl PatternData {
|
||||||
|
|
||||||
#[cfg(feature="hexotk")]
|
#[cfg(feature="hexotk")]
|
||||||
pub use hexotk::widgets::UIPatternModel;
|
pub use hexotk::widgets::UIPatternModel;
|
||||||
|
|
||||||
|
#[cfg(not(feature="hexotk"))]
|
||||||
|
impl dyn UIPatternModel {
|
||||||
|
fn change_value(&mut self, row: usize, col: usize, offs: i16) {
|
||||||
|
let val = self.get_cell_value(row, col) as i16;
|
||||||
|
let val = (val + offs).max(0).min(0xfff);
|
||||||
|
self.set_cell_value(row, col, val as u16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(not(feature="hexotk"))]
|
#[cfg(not(feature="hexotk"))]
|
||||||
pub trait UIPatternModel: std::fmt::Debug {
|
pub trait UIPatternModel: std::fmt::Debug {
|
||||||
fn get_cell(&mut self, row: usize, col: usize) -> Option<&str>;
|
fn get_cell(&mut self, row: usize, col: usize) -> Option<&str>;
|
||||||
|
|
Loading…
Reference in a new issue