update yoga

This commit is contained in:
2019-08-14 22:49:45 +02:00
parent a08e8c5796
commit e959fb4d91
5 changed files with 14 additions and 14 deletions

View File

@@ -1534,7 +1534,7 @@ Here's a list of what's available in this release.
</border>
<button-custom height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<text text="UI Scale" margin="0 10 0 5" grow="1"/>
<combobox id="tools-ui-scale" height="30" width="50" margin="0 10 0 0" combo-list="0.50,0.70,0.80,0.90,1.00,1.25,1.50,2.00,2.50"/>
<combobox id="tools-ui-scale" height="30" width="50" margin="0 10 0 0" combo-list="0.50,0.75,0.80,0.90,1.00,1.25,1.50,2.00,2.50"/>
</button-custom>
<button-custom height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<text text="VP Scale" margin="0 10 0 5" grow="1"/>
@@ -1815,7 +1815,7 @@ Here's a list of what's available in this release.
<scroll id="drop-left" color="0 0 0 .6" min-width="10" mouse-capture="true" rtl="ltr"/>
<node dir="col" width="1" grow="1">
<node dir="col" width="1" grow="1" height="100%">
<!-- timeline -->
<node width="100%" shrink="1" dir="col" rtl="ltr" id="timeline">
<border color=".3 .3 .3 .4" height="50" width="100%" pad="10" dir="row" mouse-capture="true">

View File

@@ -495,8 +495,8 @@ bool App::update_ui_observer(Node *n)
n->handle_on_screen(false, true);
n->m_on_screen = true;
}
glm::ivec4 c = glm::vec4((int)box.x, (int)(height / zoom - box.y - box.w), (int)box.z, (int)box.w) * zoom;
glScissor(c.x + off_x, c.y + off_y, c.z, c.w);
glm::ivec4 c = glm::vec4(box.x, (height / zoom - box.y - box.w), box.z, box.w) * zoom;
glScissor(floorf(c.x + off_x), floorf(c.y + off_y), ceilf(c.z), ceilf(c.w));
n->draw();
return true;
}
@@ -532,7 +532,7 @@ void App::draw(float dt)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
glViewport(off_x, off_y, (GLsizei)width, (GLsizei)height);
glEnable(GL_SCISSOR_TEST);
//glEnable(GL_SCISSOR_TEST);
for (int i = 0; i < layout[main_id]->m_children.size(); i++)
layout[main_id]->m_children[i]->watch(observer);
//msgbox->watch(observer);

View File

@@ -926,8 +926,8 @@ int main(int argc, char** argv)
WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
WGL_COLOR_BITS_ARB, 32,
WGL_DEPTH_BITS_ARB, 24,
WGL_COLOR_BITS_ARB, 24,
WGL_DEPTH_BITS_ARB, 16,
//WGL_STENCIL_BITS_ARB, 8,
//WGL_SAMPLE_BUFFERS_ARB, 1, // Number of buffers (must be 1 at time of writing)
//WGL_SAMPLES_ARB, 4, // Number of samples

View File

@@ -955,10 +955,10 @@ void Node::clear_context()
void Node::update(float width, float height, float zoom)
{
m_zoom = zoom;
YGNodeStyleSetWidth(y_node, width / zoom);
YGNodeStyleSetHeight(y_node, height / zoom);
YGNodeStyleSetWidth(y_node, ceilf(width / zoom));
YGNodeStyleSetHeight(y_node, ceilf(height / zoom));
YGNodeCalculateLayout(y_node, YGUndefined, YGUndefined, YGDirectionLTR);
m_proj = glm::ortho(0.f, width / zoom, height / zoom, 0.f, -1.f, 1.f);
m_proj = glm::ortho(0.f, ceilf(width / zoom), ceilf(height / zoom), 0.f, -1.f, 1.f);
update_internal({ 0, 0 }, m_proj, zoom);
}
@@ -976,9 +976,9 @@ void Node::update_internal(const glm::vec2& origin, const glm::mat4& proj, float
float h = YGNodeLayoutGetHeight(y_node);
auto old_size = m_size;
glm::vec2 parent_offset = m_parent ? m_parent->m_pos_offset_childred : glm::vec2(0.f);
m_pos = glm::floor(origin + glm::vec2(x, y) + m_pos_offset + parent_offset);
m_pos_origin = glm::floor(origin + glm::vec2(x, y));
m_size = glm::floor(glm::vec2(w, h));
m_pos = /*glm::floor*/(origin + glm::vec2(x, y) + m_pos_offset + parent_offset);
m_pos_origin = /*glm::floor*/(origin + glm::vec2(x, y));
m_size = /*glm::floor*/(glm::vec2(w, h));
if (m_parent)
{