dpi zoom on title bar
This commit is contained in:
@@ -1634,6 +1634,9 @@ Here's a list of what's available in this release.
|
||||
<border id="ext-fbf" height="20" width="30" color="0 0 0 1" align="center" justify="center" margin="0 5 0 0">
|
||||
<text id="txt-rec" text="FbF" color="0 0 0 1"/>
|
||||
</border>
|
||||
<border id="ext-dpi" height="20" width="50" color=".2" align="center" justify="center" margin="0 5 0 0">
|
||||
<text id="txt-dpi" text="4x-dpi" color="1"/>
|
||||
</border>
|
||||
</node>
|
||||
</border>
|
||||
<!-- toolbar -->
|
||||
|
||||
@@ -14,6 +14,8 @@ void App::title_update()
|
||||
snprintf(str, 256, "Panodoc: %s%s (%s)", doc_name.c_str(), canvas->m_canvas->m_unsaved ? "*" : "", res_to_string(canvas->m_canvas->m_width).c_str());
|
||||
if (auto docname = layout[main_id]->find<NodeText>("txt-docname"))
|
||||
docname->set_text(str);
|
||||
if (auto node = layout[main_id]->find<NodeText>("txt-dpi"))
|
||||
node->set_text(fmt::format("{}x-dpi", zoom).c_str());
|
||||
}
|
||||
|
||||
void App::init_toolbar_main()
|
||||
|
||||
@@ -107,14 +107,25 @@ void NodeCanvas::draw()
|
||||
m_canvas->m_plane_shape[plane_index] = m_canvas->face_to_shape2D(plane_index);
|
||||
}
|
||||
|
||||
|
||||
if (zoom > 1.f)
|
||||
{
|
||||
m_rtt.bindFramebuffer();
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(0, 0, m_rtt.getWidth(), m_rtt.getHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(c.x + App::I.off_x, c.y + App::I.off_y, c.z, c.w);
|
||||
}
|
||||
|
||||
// NOTE: draw_merge has been disabled for worst performance
|
||||
bool draw_merged = !(m_canvas->m_current_mode == kCanvasMode::Camera);
|
||||
draw_merged = false;
|
||||
|
||||
m_rtt.bindFramebuffer();
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(0, 0, m_rtt.getWidth(), m_rtt.getHeight());
|
||||
|
||||
if (draw_merged)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
@@ -404,18 +415,18 @@ void NodeCanvas::draw()
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
//draw the grid
|
||||
//for (int plane_index = 0; plane_index < 6; plane_index++)
|
||||
//{
|
||||
// auto plane_mvp = proj * camera *
|
||||
// glm::scale(glm::vec3(m_canvas->m_order.size() + 500.f)) *
|
||||
// m_canvas->m_plane_transform[plane_index] *
|
||||
// glm::translate(glm::vec3(0, 0, -1.f));
|
||||
for (int plane_index = 0; plane_index < 6; plane_index++)
|
||||
{
|
||||
auto plane_mvp = proj * camera *
|
||||
glm::scale(glm::vec3(m_canvas->m_order.size() + 500.f)) *
|
||||
m_canvas->m_plane_transform[plane_index] *
|
||||
glm::translate(glm::vec3(0, 0, -1.f));
|
||||
|
||||
// ShaderManager::use(kShader::Checkerboard);
|
||||
// ShaderManager::u_int(kShaderUniform::Colorize, false);
|
||||
// ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp);
|
||||
// m_face_plane.draw_fill();
|
||||
//}
|
||||
ShaderManager::use(kShader::Checkerboard);
|
||||
ShaderManager::u_int(kShaderUniform::Colorize, false);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp);
|
||||
m_face_plane.draw_fill();
|
||||
}
|
||||
|
||||
// draw the layers
|
||||
m_sampler.bind(0);
|
||||
@@ -429,21 +440,24 @@ void NodeCanvas::draw()
|
||||
}
|
||||
}
|
||||
|
||||
m_rtt.unbindFramebuffer();
|
||||
if (zoom > 1.f)
|
||||
{
|
||||
m_rtt.unbindFramebuffer();
|
||||
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(c.x + App::I.off_x, c.y + App::I.off_y, c.z, c.w);
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glViewport(c.x + App::I.off_x, c.y + App::I.off_y, c.z, c.w);
|
||||
|
||||
// draw the canvas
|
||||
m_sampler_linear.bind(0);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
m_rtt.bindTexture();
|
||||
ShaderManager::use(kShader::Texture);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho<float>(-1, 1, -1, 1));
|
||||
m_face_plane.draw_fill();
|
||||
m_rtt.unbindTexture();
|
||||
// draw the canvas
|
||||
m_sampler_linear.bind(0);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
m_rtt.bindTexture();
|
||||
ShaderManager::use(kShader::Texture);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho<float>(-1, 1, -1, 1));
|
||||
m_face_plane.draw_fill();
|
||||
m_rtt.unbindTexture();
|
||||
}
|
||||
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
Reference in New Issue
Block a user