disable default brush pressure, set 3 different quick brushes at startup
This commit is contained in:
@@ -45,7 +45,7 @@ public:
|
||||
bool m_tip_angle_follow = false;
|
||||
bool m_tip_flow_pressure = false;
|
||||
bool m_tip_opacity_pressure = false;
|
||||
bool m_tip_size_pressure = true;
|
||||
bool m_tip_size_pressure = false;
|
||||
float m_jitter_scale = 0;
|
||||
float m_jitter_angle = 0;
|
||||
float m_jitter_scatter = 0;
|
||||
|
||||
@@ -167,19 +167,22 @@ void NodePanelQuick::init_controls()
|
||||
m_button_color_current->set_active(true);
|
||||
m_button_color_current_inner = static_cast<NodeBorder*>(m_button_color_current->m_children[0].get());
|
||||
|
||||
for (int i = 0; i < m_button_brushes.size(); i++)
|
||||
m_button_brushes[i] = init_button_brush(fmt::format("quick-brush{}", i + 1));
|
||||
m_button_brushes[0] = init_button_brush("quick-brush1", true, false);
|
||||
m_button_brushes[1] = init_button_brush("quick-brush2", false, true);
|
||||
m_button_brushes[2] = init_button_brush("quick-brush3", false, false);
|
||||
m_button_brush_current = m_button_brushes[0];
|
||||
m_button_brush_current->set_active(true);
|
||||
m_button_brush_current_preview = static_cast<NodeStrokePreview*>(m_button_brush_current->m_children[0].get());
|
||||
}
|
||||
|
||||
NodeButtonCustom* NodePanelQuick::init_button_brush(const std::string& name)
|
||||
NodeButtonCustom* NodePanelQuick::init_button_brush(const std::string& name, bool szp, bool flp)
|
||||
{
|
||||
auto button = find<NodeButtonCustom>(name.c_str());
|
||||
button->on_click = std::bind(&this_class::handle_button_brush_click, this, std::placeholders::_1);
|
||||
auto pr = static_cast<NodeStrokePreview*>(button->m_children[0].get());
|
||||
pr->m_brush = std::make_shared<Brush>();;
|
||||
pr->m_brush = std::make_shared<Brush>();
|
||||
pr->m_brush->m_tip_size_pressure = szp;
|
||||
pr->m_brush->m_tip_flow_pressure = flp;
|
||||
pr->m_brush->load_tip("data/brushes/Round-Hard.png", "data/brushes/thumbs/Round-Hard.png");
|
||||
pr->m_max_size = 20;
|
||||
pr->m_pad_override = 0;
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
private:
|
||||
void init_controls();
|
||||
NodeButtonCustom* init_button_brush(const std::string& name);
|
||||
NodeButtonCustom* init_button_brush(const std::string& name, bool szp, bool flp);
|
||||
void handle_button_brush_click(Node* target);
|
||||
void handle_button_color_click(Node* target);
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ void save_recovery()
|
||||
auto path = App::I->data_path + "/" + App::I->doc_name + "-recovery (" + oss.str() + ").ppi";
|
||||
|
||||
if (App::I->canvas && App::I->canvas->m_canvas)
|
||||
App::I->canvas->m_canvas->project_save_thread(path);
|
||||
App::I->canvas->m_canvas->project_save_thread(path, false);
|
||||
}
|
||||
|
||||
void exception_handler(NSException *exception)
|
||||
|
||||
Reference in New Issue
Block a user