iOS: fix app id in path, pen pressure filtering on Line

This commit is contained in:
2019-03-11 11:40:17 +01:00
parent 5cd80f41fa
commit 373e7ad0e9
6 changed files with 48 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
#include "log.h"
#include "brush.h"
#include "asset.h"
#include "app.h"
void BrushMesh::draw(const std::vector<StrokeSample>& samples, const glm::mat4& proj)
{
@@ -491,11 +492,17 @@ bool Brush::read(BinaryStreamReader& r)
r >> d;
d.value<Serializer::CString>("m_name", m_name);
d.value<Serializer::CString>("m_brush_path", m_brush_path);
m_brush_path = str_replace(m_brush_path, "{data_path}", App::I.data_path);
d.value<Serializer::CString>("m_brush_thumb_path", m_brush_thumb_path);
m_brush_thumb_path = str_replace(m_brush_thumb_path, "{data_path}", App::I.data_path);
d.value<Serializer::CString>("m_dual_path", m_dual_path);
m_dual_path = str_replace(m_dual_path, "{data_path}", App::I.data_path);
d.value<Serializer::CString>("m_dual_thumb_path", m_dual_thumb_path);
m_dual_thumb_path = str_replace(m_dual_thumb_path, "{data_path}", App::I.data_path);
d.value<Serializer::CString>("m_pattern_path", m_pattern_path);
m_pattern_path = str_replace(m_pattern_path, "{data_path}", App::I.data_path);
d.value<Serializer::CString>("m_pattern_thumb_path", m_pattern_thumb_path);
m_pattern_thumb_path = str_replace(m_pattern_thumb_path, "{data_path}", App::I.data_path);
d.value<Serializer::Vec4>("m_tip_color", m_tip_color);
d.value<Serializer::Vec2>("m_tip_scale", m_tip_scale);
@@ -576,12 +583,18 @@ void Brush::write(BinaryStreamWriter& w) const
d.class_id = "brush";
d.name = L"Brush class";
d.props["m_name"] = std::make_shared<Serializer::CString>(m_name);
d.props["m_brush_path"] = std::make_shared<Serializer::CString>(m_brush_path);
d.props["m_brush_thumb_path"] = std::make_shared<Serializer::CString>(m_brush_thumb_path);
d.props["m_dual_path"] = std::make_shared<Serializer::CString>(m_dual_path);
d.props["m_dual_thumb_path"] = std::make_shared<Serializer::CString>(m_dual_thumb_path);
d.props["m_pattern_path"] = std::make_shared<Serializer::CString>(m_pattern_path);
d.props["m_pattern_thumb_path"] = std::make_shared<Serializer::CString>(m_pattern_thumb_path);
d.props["m_brush_path"] = std::make_shared<Serializer::CString>(
str_replace(m_brush_path, App::I.data_path, "{data_path}"));
d.props["m_brush_thumb_path"] = std::make_shared<Serializer::CString>(
str_replace(m_brush_thumb_path, App::I.data_path, "{data_path}"));
d.props["m_dual_path"] = std::make_shared<Serializer::CString>(
str_replace(m_dual_path, App::I.data_path, "{data_path}"));
d.props["m_dual_thumb_path"] = std::make_shared<Serializer::CString>(
str_replace(m_dual_thumb_path, App::I.data_path, "{data_path}"));
d.props["m_pattern_path"] = std::make_shared<Serializer::CString>(
str_replace(m_pattern_path, App::I.data_path, "{data_path}"));
d.props["m_pattern_thumb_path"] = std::make_shared<Serializer::CString>(
str_replace(m_pattern_thumb_path, App::I.data_path, "{data_path}"));
d.props["m_tip_color"] = std::make_shared<Serializer::Vec4>(m_tip_color);
d.props["m_tip_scale"] = std::make_shared<Serializer::Vec2>(m_tip_scale);