small fixes

This commit is contained in:
2018-08-05 21:58:44 +02:00
parent 0fb6658373
commit 698bd58b33
2 changed files with 11 additions and 4 deletions

View File

@@ -42,7 +42,6 @@ void App::dialog_newdoc()
std::array<int, 4> resolutions{ 512, 1024, 1536, 2048 };
int res = resolutions[dialog->m_resolution->m_current_index];
doc_name = name;
title_update();
layers->clear();
canvas->m_canvas->m_layers.clear();
@@ -54,6 +53,8 @@ void App::dialog_newdoc()
canvas->m_canvas->layer_add("Default");
layers->add_layer("Default");
title_update();
dialog->destroy();
App::I.hideKeyboard();
};

View File

@@ -16,7 +16,10 @@ void NodeCanvas::init()
m_canvas->create(CANVAS_RES, CANVAS_RES);
m_canvas->m_unsaved = false;
m_canvas->m_node = this;
m_sampler.create(GL_NEAREST);
m_sampler.create();
m_sampler.set_filter(GL_LINEAR, GL_NEAREST);
m_sampler_linear.create(GL_LINEAR);
m_sampler_stencil.create(GL_LINEAR, GL_REPEAT);
m_face_plane.create<1>(2, 2);
@@ -32,7 +35,10 @@ void NodeCanvas::restore_context()
{
Node::restore_context();
m_canvas->create(CANVAS_RES, CANVAS_RES);
m_sampler.create(GL_NEAREST);
m_sampler.create();
m_sampler.set_filter(GL_LINEAR, GL_NEAREST);
m_face_plane.create<1>(2, 2);
m_canvas->snapshot_restore();
CanvasMode::node = this;
@@ -278,7 +284,7 @@ void NodeCanvas::draw()
void NodeCanvas::handle_resize(glm::vec2 old_size, glm::vec2 new_size)
{
if (new_size.x > m_canvas->m_width)
if (new_size.x != m_canvas->m_width || new_size.y != m_canvas->m_height)
{
#if __IOS__
m_canvas->m_mixer.create((int)new_size.x * m_canvas->m_mixer_scale,