ENH:optimize method of gcodeviewer marker get current move

Change-Id: I935d8da52212156b4158d727b49d8b0e51105fa3
(cherry picked from commit 4826570649608691184c05260edf4c074dccb780)
This commit is contained in:
liz.li 2023-01-10 17:30:57 +08:00 committed by Lane.Wei
parent 70a0f09ea2
commit fdba5967fa
3 changed files with 33 additions and 21 deletions

View file

@ -618,6 +618,7 @@ public:
// see implementation of render() method
Vec3f m_world_offset;
float m_z_offset{ 0.5f };
GCodeProcessorResult::MoveVertex m_curr_move;
bool m_visible{ true };
bool m_is_dark = false;
@ -635,8 +636,10 @@ public:
void set_visible(bool visible) { m_visible = visible; }
//BBS: GUI refactor: add canvas size
void render(int canvas_width, int canvas_height, const EViewType& view_type, const std::vector<GCodeProcessorResult::MoveVertex>& moves, uint64_t curr_line_id) const;
void render(int canvas_width, int canvas_height, const EViewType& view_type) const;
void on_change_color_mode(bool is_dark) { m_is_dark = is_dark; }
void update_curr_move(const GCodeProcessorResult::MoveVertex move);
};
class GCodeWindow
@ -696,7 +699,7 @@ public:
float m_scale = 1.0;
//BBS: GUI refactor: add canvas size
void render(float legend_height, int canvas_width, int canvas_height, const EViewType& view_type, const std::vector<GCodeProcessorResult::MoveVertex>& moves) const;
void render(float legend_height, int canvas_width, int canvas_height, const EViewType& view_type) const;
};
struct ETools
@ -830,6 +833,7 @@ public:
void enable_moves_slider(bool enable) const;
void update_moves_slider(bool set_to_max = false);
void update_layers_slider_mode();
void update_marker_curr_move();
bool is_contained_in_bed() const { return m_contained_in_bed; }
//BBS: add only gcode mode