hide cursor on canvas, add mouse focus event, brush preview solid when small
This commit is contained in:
@@ -41,18 +41,36 @@ void NodePanelQuick::init_controls()
|
||||
|
||||
m_slider_size = find<NodeSliderV>("quick-size");
|
||||
m_slider_size->on_value_changed = [this](Node* target, float value) {
|
||||
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
||||
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||
m->m_draw_tip = true;
|
||||
auto newpos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||
if (auto m = dynamic_cast<CanvasModePen*>(Canvas::I->modes[(int)Canvas::I->m_current_mode][0]))
|
||||
{
|
||||
m->m_cur_pos = newpos;
|
||||
m->m_draw_tip = true;
|
||||
m->m_draw_outline = false;
|
||||
}
|
||||
if (auto m = dynamic_cast<CanvasModeLine*>(Canvas::I->modes[(int)Canvas::I->m_current_mode][0]))
|
||||
{
|
||||
m->m_cur_pos = newpos;
|
||||
m->m_draw_tip = true;
|
||||
}
|
||||
m_button_brush_current_preview->draw_stroke();
|
||||
if (on_size_change)
|
||||
on_size_change(target, value);
|
||||
};
|
||||
m_slider_flow = find<NodeSliderV>("quick-flow");
|
||||
m_slider_flow->on_value_changed = [this](Node* target, float value) {
|
||||
auto m = static_cast<CanvasModePen*>(Canvas::I->modes[(int)kCanvasMode::Draw][0]);
|
||||
m->m_cur_pos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||
m->m_draw_tip = true;
|
||||
auto newpos = (m_slider_flow->m_pos + glm::vec2(100.f, m_slider_flow->m_size.y / 2.f)) * App::I.zoom;
|
||||
if (auto m = dynamic_cast<CanvasModePen*>(Canvas::I->modes[(int)Canvas::I->m_current_mode][0]))
|
||||
{
|
||||
m->m_cur_pos = newpos;
|
||||
m->m_draw_tip = true;
|
||||
m->m_draw_outline = false;
|
||||
}
|
||||
if (auto m = dynamic_cast<CanvasModeLine*>(Canvas::I->modes[(int)Canvas::I->m_current_mode][0]))
|
||||
{
|
||||
m->m_cur_pos = newpos;
|
||||
m->m_draw_tip = true;
|
||||
}
|
||||
m_button_brush_current_preview->draw_stroke();
|
||||
if (on_flow_change)
|
||||
on_flow_change(target, value);
|
||||
|
||||
Reference in New Issue
Block a user