improve panels, inverted brush outline color

This commit is contained in:
2019-04-06 16:17:11 +02:00
parent 1bb9b5dec5
commit 3611057f18
5 changed files with 21 additions and 4 deletions

View File

@@ -1785,6 +1785,7 @@ Here's a list of what's available in this release.
</node>
<!-- status bar -->
<border height="10" color="0 0 0 .6" mouse-capture="true"/>
<!--<border height="30" width="100%" color=".15" border-color=".3" dir="row" pad="0 0 0 10" align="center">
--><!--<text-input width="100" height="100%" color=".3"/>--><!--
<text text="Status Bar: nothing to show here."/>

View File

@@ -783,6 +783,7 @@ void App::init_menu_experimental()
if (visible(floating_presets.get()))
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->SetHeight(300);
fpanel->SetMinHeight(300);
if (!floating_presets)
{
@@ -810,6 +811,7 @@ void App::init_menu_experimental()
if (visible(floating_color.get()))
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->SetHeight(300);
fpanel->SetMinHeight(300);
if (!floating_color)
{
@@ -833,7 +835,7 @@ void App::init_menu_experimental()
if (visible(floating_picker.get()))
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->SetHeight(YGUndefined);
fpanel->SetHeight(300);
fpanel->SetWidth(300);
if (!floating_picker)
{
@@ -870,6 +872,7 @@ void App::init_menu_experimental()
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->SetMinHeight(100);
fpanel->SetHeight(300);
fpanel->m_container->add_child(layers);
layers->SetPositioning(YGPositionTypeRelative);
layers->SetPosition(0, 0);
@@ -885,6 +888,7 @@ void App::init_menu_experimental()
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->m_container->add_child(stroke);
fpanel->SetHeight(300);
stroke->SetPositioning(YGPositionTypeRelative);
stroke->SetPosition(0, 0);
@@ -896,6 +900,7 @@ void App::init_menu_experimental()
return;
auto fpanel = floatings_container->add_child<NodePanelFloating>();
fpanel->m_container->add_child(grid);
fpanel->SetHeight(300);
grid->SetPositioning(YGPositionTypeRelative);
grid->SetPosition(0, 0);
grid->SetWidthP(100);

View File

@@ -242,8 +242,11 @@ void CanvasModePen::on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const
tip_color = glm::vec4(s.col, s.flow);
}
}
ShaderManager::u_int(kShaderUniform::DrawOutline, glm::min(tip_scale.x, tip_scale.y) < 20 || m_resizing ? false : m_draw_outline);
ShaderManager::u_vec4(kShaderUniform::Col, tip_color);
glm::u8vec4 pixel;
glReadPixels(pos.x, App::I.height - pos.y - 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
bool outline = glm::min(tip_scale.x, tip_scale.y) < 20 || m_resizing ? false : m_draw_outline;
ShaderManager::u_int(kShaderUniform::DrawOutline, outline);
ShaderManager::u_vec4(kShaderUniform::Col, outline ? glm::vec4(1.f - glm::vec3(pixel) / 255.f, 1.f) : tip_color);
ShaderManager::u_mat4(kShaderUniform::MVP,
glm::scale(glm::vec3(1, -1, 1)) *
ortho *

View File

@@ -119,6 +119,14 @@ kEventResult Node::on_event(Event* e)
}
bool skip_children = false;
// skip mouse events if outside
if (e->m_cat == kEventCategory::MouseEvent)
{
MouseEvent* me = static_cast<MouseEvent*>(e);
skip_children |= m_mouse_inside && !point_in_rect(me->m_pos, m_clip);
}
skip_children |= (e->m_cat == kEventCategory::MouseEvent || e->m_cat == kEventCategory::GestureEvent) &&
(m_mouse_captured) && (root()->current_mouse_capture == this) && m_capture_children; // <-- THIS IS WRONG "!m_capture_children" is correct, but it breaks everything if changed

View File

@@ -80,7 +80,7 @@ kEventResult NodePanelFloating::handle_event(Event* e)
m_outline->SetPositioning(YGPositionTypeAbsolute);
m_outline->SetPosition(m_pos);
m_outline->SetSize(GetSize());
m_outline->m_color = { 0, 0, 0, 0.1 };
m_outline->m_color = { 0, 0, 0, 0.25 };
m_outline->m_thinkness = 1;
m_drop_placeholder = std::make_shared<NodeBorder>();
m_drop_placeholder->SetSize(350, 10);