revisions for line drawing
This commit is contained in:
parent
1dfac5728c
commit
2ff2dc45d5
2 changed files with 8 additions and 1 deletions
|
@ -375,6 +375,7 @@ fn update(_app: &App, model: &mut Model, update: Update) {
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
ui.add(egui::Label::new(format!("Lines {}", model.current_lines.lines.len())));
|
ui.add(egui::Label::new(format!("Lines {}", model.current_lines.lines.len())));
|
||||||
|
ui.add(egui::Label::new(format!("Points {}", model.current_lines.point_count())));
|
||||||
|
|
||||||
ui.heading("Laser Settings");
|
ui.heading("Laser Settings");
|
||||||
|
|
||||||
|
@ -514,7 +515,6 @@ fn view_line_canvas(app: &App, model: &Model, frame: Frame) {
|
||||||
// let hz = ((app.mouse.x + win.right()) / win.w()).powi(4) * 1000.0;
|
// let hz = ((app.mouse.x + win.right()) / win.w()).powi(4) * 1000.0;
|
||||||
|
|
||||||
// TODO refactor to using euclid::point2D for scale
|
// TODO refactor to using euclid::point2D for scale
|
||||||
|
|
||||||
for line in &model.current_lines.lines{
|
for line in &model.current_lines.lines{
|
||||||
let vertices = line.points.iter().map(|p| {
|
let vertices = line.points.iter().map(|p| {
|
||||||
let color = srgba(p.color.red, p.color.green, p.color.blue, p.color.alpha);
|
let color = srgba(p.color.red, p.color.green, p.color.blue, p.color.alpha);
|
||||||
|
|
|
@ -66,6 +66,13 @@ impl RenderableLines{
|
||||||
// self.lines.append(rl.lines);
|
// self.lines.append(rl.lines);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
pub fn point_count(&self) -> usize {
|
||||||
|
let s = self.lines.iter().map(|x| x.points.len()).sum();
|
||||||
|
s
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&RenderablePoint> for laser::Point {
|
impl From<&RenderablePoint> for laser::Point {
|
||||||
|
|
Loading…
Reference in a new issue