edited grapher implementation
- fixed grapher implementation with new gui - fixed a bug in CgLineEdit where pressing backspace on an empty input would cause a crash
This commit is contained in:
@@ -64,7 +64,7 @@ impl CgTextEdit for CgLineEdit {
|
||||
self.ptr += 1;
|
||||
}
|
||||
fn backspace(&mut self) {
|
||||
if self.ptr >= 0 {
|
||||
if self.ptr > 0 {
|
||||
self.ptr -= 1;
|
||||
self.text.remove(self.ptr);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ impl CgComponent for CgContainer<'_> {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CgTextBox {
|
||||
title: String,
|
||||
content: String,
|
||||
pub content: String,
|
||||
pub position: Position,
|
||||
pub dimensions: Dimensions,
|
||||
outlined: bool,
|
||||
@@ -85,7 +85,7 @@ pub struct CgTextBox {
|
||||
|
||||
impl CgTextBox {
|
||||
pub fn new(title: String, content: String, position: Position, dimensions: Dimensions, outlined: bool) -> CgTextBox {
|
||||
CgTextBox { title, content, position, dimensions, outlined, wrap_words: false }
|
||||
CgTextBox { title, content, position, dimensions, outlined, wrap_words: true }
|
||||
}
|
||||
|
||||
fn render_title(&self, frame: &mut Frame) {
|
||||
|
||||
Reference in New Issue
Block a user