increase stroke preview pad, fix message box capture behavior

This commit is contained in:
2019-02-28 10:23:34 +01:00
parent d0071de461
commit a961630eb4
4 changed files with 14 additions and 3 deletions

View File

@@ -400,7 +400,9 @@ void Node::mouse_capture()
// so preserve direct parents of this
// also clear the whole stack
s.clear();
//s.clear();
s.push_back(c);
}
}

View File

@@ -22,6 +22,7 @@ void NodeMessageBox::init()
btn_ok->on_click = [&](Node*) { destroy(); };
btn_cancel = m_template->find<NodeButton>("btn-cancel");
on_submit = btn_cancel->on_click = [&](Node*) { destroy(); };
m_capture_children = false; // don't capture children events on mouse_capture
}
kEventResult NodeMessageBox::handle_event(Event* e)
@@ -44,3 +45,9 @@ kEventResult NodeMessageBox::handle_event(Event* e)
}
return kEventResult::Consumed;
}
void NodeMessageBox::added(Node* parent)
{
Node::added(parent);
mouse_capture();
}

View File

@@ -15,4 +15,5 @@ public:
virtual Node* clone_instantiate() const override;
virtual void init() override;
virtual kEventResult handle_event(Event* e) override;
virtual void added(Node* parent) override;
};

View File

@@ -283,9 +283,10 @@ void NodeStrokePreview::draw_stroke()
}
{
float pad = glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, 10.f);
float pad = (5.f + glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, 10.f)) * App::I.zoom;
if (b->m_tip_size_pressure)
pad = 10.f;
pad = 10.f * App::I.zoom;
float w = m_size.x * App::I.zoom;
float h = m_size.y * App::I.zoom;
std::vector<glm::vec2> kp = {