implement frames save and open from ppi

This commit is contained in:
2019-10-17 23:41:37 +02:00
parent 880eb7a406
commit 4e0520da80
9 changed files with 165 additions and 128 deletions

View File

@@ -83,7 +83,7 @@ void NodePanelBrush::init()
m_btn_add->on_click = [this](Node*) {
App::I->pick_file({ "JPG", "PNG" }, [this](std::string path) {
std::string name, base, ext;
std::regex r(R"((.*)[\\/]?([^\\/]+)\.(\w+)$)");
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
std::smatch m;
if (!std::regex_search(path, m, r))
return;
@@ -708,7 +708,7 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path_in, const PPBRInf
path += ".ppbr";
LOG("export ppbr to: %s", path.c_str());
std::regex r(R"((.*)[\\/]?([^\\/]+)\.(\w+)?$)");
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)?$)");
std::smatch m;
if (!std::regex_search(path, m, r))
return false;
@@ -972,7 +972,7 @@ bool NodePanelBrushPreset::import_abr(const std::string& path)
LOG("ABR detected");
std::string name, base, ext;
std::regex r(R"((.*)[\\/]?([^\\/]+)\.(\w+)$)");
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
std::smatch m;
if (!std::regex_search(path, m, r))
return false;
@@ -1042,7 +1042,7 @@ bool NodePanelBrushPreset::import_abr(const std::string& path)
bool NodePanelBrushPreset::import_brush(const std::string& path)
{
std::regex r(R"((.*)[\\/]?([^\\/]+)\.(\w+)$)");
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
std::smatch m;
if (!std::regex_search(path, m, r))
return false;