implement stencil from file
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include "log.h"
|
||||
#include "node_panel_stroke.h"
|
||||
#include "canvas.h"
|
||||
#include "node_button.h"
|
||||
#include "app.h"
|
||||
|
||||
Node* NodePanelStroke::clone_instantiate() const
|
||||
{
|
||||
@@ -85,6 +87,17 @@ void NodePanelStroke::init_controls()
|
||||
|
||||
m_preview->m_brush = Canvas::I->m_current_brush;
|
||||
m_preview->draw_stroke();
|
||||
|
||||
auto load_stencil = find<NodeButton>("tip-stencil-load");
|
||||
load_stencil->on_click = [this](Node*) {
|
||||
App::I.pick_image([this](std::string path) {
|
||||
if (TextureManager::load(path.c_str()))
|
||||
{
|
||||
if (on_stencil_changed)
|
||||
on_stencil_changed(this, const_hash(path.c_str()));
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
void NodePanelStroke::init_slider(NodeSliderH*& target, const char* id, float Brush::* prop)
|
||||
|
||||
Reference in New Issue
Block a user