fix color picker

This commit is contained in:
2018-03-08 22:36:12 +01:00
parent 0bdb879e76
commit 485c0ee933
4 changed files with 13 additions and 7 deletions

View File

@@ -61,10 +61,12 @@ add_library(
../engine/node_canvas.cpp
../engine/node_checkbox.cpp
../engine/node_color_quad.cpp
../engine/node_colorwheel.cpp
../engine/node_combobox.cpp
../engine/node_dialog_browse.cpp
../engine/node_dialog_cloud.cpp
../engine/node_dialog_open.cpp
../engine/node_dialog_picker.cpp
../engine/node_dialog_layer_rename.cpp
../engine/node_icon.cpp
../engine/node_image.cpp

View File

@@ -4,6 +4,7 @@
#include "node_dialog_open.h"
#include "node_text.h"
#include "node_progress_bar.h"
#include "node_dialog_picker.h"
using namespace ui;
@@ -219,9 +220,11 @@ void App::init_sidebar()
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-color"))
{
button->on_click = [this, button](Node*) {
panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
panels->fix_scroll();
button->set_color(panels->get_child_index(color.get()) == -1 ? color_button_normal : color_button_hlight);
// panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
// panels->fix_scroll();
// button->set_color(panels->get_child_index(color.get()) == -1 ? color_button_normal : color_button_hlight);
auto pick = layout[main_id]->add_child<NodeColorPicker>();
pick->m_color_cur->m_color = ui::Canvas::I->m_current_brush.m_tip_color;
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-layer"))

View File

@@ -907,7 +907,7 @@ void ui::Canvas::export_equirectangular_thread(std::string file_path)
m_tmp[i].clear({ 1, 1, 1, 1 });
glActiveTexture(GL_TEXTURE0); // TODO: maybe remove this line
m_sampler.bind(0);
m_sampler_mask.bind(0);
for (auto layer_index : m_order)
{
ShaderManager::u_float(kShaderUniform::Alpha, m_layers[layer_index].m_opacity);
@@ -915,7 +915,7 @@ void ui::Canvas::export_equirectangular_thread(std::string file_path)
m_plane.draw_fill();
m_layers[layer_index].m_rtt[i].unbindTexture();
}
m_sampler.unbind();
m_sampler_mask.unbind();
// copy result to cubemap
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
@@ -955,9 +955,9 @@ void ui::Canvas::export_equirectangular_thread(std::string file_path)
ui::ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
m_sampler.bind(0);
m_sampler_mask.bind(0);
m_plane.draw_fill();
m_sampler.unbind();
m_sampler_mask.unbind();
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
m_latlong.unbindFramebuffer();
{

View File

@@ -50,6 +50,7 @@ void NodePanelColor::set_color(glm::vec3 rgb)
m_quad->m_value = glm::vec2(hsv.y, 1.f - hsv.z);
m_quad->m_color = glm::vec4(rgb, 1);
m_cursor = m_quad->m_value;
m_base_color = glm::vec4(rgb, 1);
}
void NodePanelColor::added(Node* parent)