Editor namespace housekeeping, Canvas expansion
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace gui {
|
||||
|
||||
class Canvas {
|
||||
public:
|
||||
Canvas() = default;
|
||||
@@ -17,11 +17,16 @@ class Canvas {
|
||||
|
||||
void Update();
|
||||
|
||||
void DrawBackground();
|
||||
void DrawBackground(ImVec2 canvas_size = ImVec2(0, 0));
|
||||
void UpdateContext();
|
||||
void DrawGrid();
|
||||
void DrawGrid(float grid_step = 64.0f);
|
||||
void DrawOverlay(); // last
|
||||
|
||||
void SetCanvasSize(ImVec2 canvas_size) {
|
||||
canvas_sz_ = canvas_size;
|
||||
custom_canvas_size_ = true;
|
||||
}
|
||||
auto GetDrawList() const { return draw_list_; }
|
||||
auto GetZeroPoint() const { return canvas_p0_; }
|
||||
|
||||
private:
|
||||
@@ -30,15 +35,16 @@ class Canvas {
|
||||
bool dragging_select_ = false;
|
||||
bool custom_canvas_size_ = false;
|
||||
|
||||
std::string title_;
|
||||
|
||||
ImDrawList* draw_list_;
|
||||
ImVector<ImVec2> points_;
|
||||
ImVec2 scrolling_;
|
||||
ImVec2 canvas_sz_;
|
||||
ImVec2 canvas_p0_;
|
||||
ImVec2 canvas_p1_;
|
||||
|
||||
std::string title_;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
} // namespace yaze
|
||||
|
||||
|
||||
Reference in New Issue
Block a user