added render target and bezier classes, added stroke settings panel

This commit is contained in:
2017-03-24 03:15:29 +00:00
parent 03a5212e56
commit a2cb0ecafe
16 changed files with 798 additions and 67 deletions

View File

@@ -9,6 +9,7 @@ Plane NodeBorder::m_plane;
Plane NodeImage::m_plane;
Sampler NodeImage::m_sampler;
std::map<std::string, glm::vec4> NodeIcon::m_icons;
ui::Shader NodeCanvas2D::m_shader;
kEventResult Node::on_event(Event* e)
{
@@ -177,6 +178,7 @@ void Node::update_internal(const glm::vec2& origin, const glm::mat4& proj)
float y = YGNodeLayoutGetTop(y_node);
float w = YGNodeLayoutGetWidth(y_node);
float h = YGNodeLayoutGetHeight(y_node);
auto old_size = m_size;
m_pos = glm::floor(origin + glm::vec2(x, y));
m_size = glm::floor(glm::vec2(w, h));
@@ -215,6 +217,9 @@ void Node::update_internal(const glm::vec2& origin, const glm::mat4& proj)
}
}
if (m_size != old_size)
handle_resize(old_size, m_size);
for (auto& c : m_children)
c->update_internal(m_pos, proj);
}
@@ -433,9 +438,12 @@ void Node::load_internal(const tinyxml2::XMLElement* x_node)
CASE(kWidget::Viewport, NodeViewport);
CASE(kWidget::CheckBox, NodeCheckBox);
CASE(kWidget::Layer, NodeLayer);
CASE(kWidget::PanelLayers, NodePanelLayers);
CASE(kWidget::PanelBrushes, NodePanelBrushes);
CASE(kWidget::PanelLayer, NodePanelLayer);
CASE(kWidget::PanelBrush, NodePanelBrush);
CASE(kWidget::PanelColor, NodePanelColor);
CASE(kWidget::PanelStroke, NodePanelStroke);
CASE(kWidget::ColorQuad, NodeColorQuad);
CASE(kWidget::Canvas2D, NodeCanvas2D);
#undef CASE
case kWidget::Ref:
{
@@ -496,7 +504,7 @@ void Node::clone_children(Node* dest) const
Node* cn = c->clone();
dest->m_children.emplace_back(cn);
cn->parent = dest;
cn->m_manager = m_manager;
cn->m_manager = dest->m_manager;
YGNodeInsertChild(dest->y_node, cn->y_node, YGNodeGetChildCount(dest->y_node));
}
}