implement document resize with menu and dialog

This commit is contained in:
2018-10-05 18:10:26 +02:00
parent 4723bedc31
commit 5baa807cce
14 changed files with 245 additions and 15 deletions

View File

@@ -29,12 +29,27 @@ public:
std::unique_ptr<uint8_t[]> image[6] = SIXPLETTE(0);
glm::vec4 m_dirty_box[6] = SIXPLETTE(glm::vec4(0));
bool m_dirty_face[6] = SIXPLETTE(false);
int width = 0;
int height = 0;
void create(int w, int h)
{
for (int i = 0; i < 6; i++)
{
image[i] = std::make_unique<uint8_t[]>(w*h*4);
std::fill_n(image[i].get(), w*h*4, 0);
}
}
void clear()
{
for (int i = 0; i < 6; i++)
{
m_dirty_face[i] = false;
m_dirty_box[i] = glm::vec4(0);
std::fill_n(image[i].get(), width*height*4, 0);
}
}
};
void resize(int width, int height);
bool create(int width, int height, std::string name);
void clear(const glm::vec4& c);
Snapshot snapshot(std::string data_path);
@@ -182,6 +197,7 @@ public:
void stroke_cancel();
void stroke_commit();
void clear(const glm::vec4& color = { 1, 1, 1, 0 });
void clear_all();
void pick_start();
void pick_update(int plane);
glm::vec4 pick_get(glm::vec2 canvas_loc);