From e959fb4d912d53c496ad9d205427996fcb73e152 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Wed, 14 Aug 2019 22:49:45 +0200 Subject: [PATCH] update yoga --- data/layout.xml | 4 ++-- libs/yoga | 2 +- src/app.cpp | 6 +++--- src/main.cpp | 4 ++-- src/node.cpp | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/data/layout.xml b/data/layout.xml index fe3e9b7..41e58d2 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -1534,7 +1534,7 @@ Here's a list of what's available in this release. - + @@ -1815,7 +1815,7 @@ Here's a list of what's available in this release. - + diff --git a/libs/yoga b/libs/yoga index f793ba2..7fc6fcb 160000 --- a/libs/yoga +++ b/libs/yoga @@ -1 +1 @@ -Subproject commit f793ba2d6bfa5ef9631b83f34df65d4e2a9ad0a9 +Subproject commit 7fc6fcb38cf44e556b882b1700be699abbb56a36 diff --git a/src/app.cpp b/src/app.cpp index a758cdf..596ece9 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -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); diff --git a/src/main.cpp b/src/main.cpp index c892619..63d3327 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 diff --git a/src/node.cpp b/src/node.cpp index 6b7213a..02984fa 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -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) {