implement stencil from file

This commit is contained in:
2019-01-15 23:54:08 +01:00
parent f5c4aed4fd
commit 9c93747b17
9 changed files with 26 additions and 7 deletions

View File

@@ -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)