fix color picker
This commit is contained in:
@@ -61,10 +61,12 @@ add_library(
|
|||||||
../engine/node_canvas.cpp
|
../engine/node_canvas.cpp
|
||||||
../engine/node_checkbox.cpp
|
../engine/node_checkbox.cpp
|
||||||
../engine/node_color_quad.cpp
|
../engine/node_color_quad.cpp
|
||||||
|
../engine/node_colorwheel.cpp
|
||||||
../engine/node_combobox.cpp
|
../engine/node_combobox.cpp
|
||||||
../engine/node_dialog_browse.cpp
|
../engine/node_dialog_browse.cpp
|
||||||
../engine/node_dialog_cloud.cpp
|
../engine/node_dialog_cloud.cpp
|
||||||
../engine/node_dialog_open.cpp
|
../engine/node_dialog_open.cpp
|
||||||
|
../engine/node_dialog_picker.cpp
|
||||||
../engine/node_dialog_layer_rename.cpp
|
../engine/node_dialog_layer_rename.cpp
|
||||||
../engine/node_icon.cpp
|
../engine/node_icon.cpp
|
||||||
../engine/node_image.cpp
|
../engine/node_image.cpp
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "node_dialog_open.h"
|
#include "node_dialog_open.h"
|
||||||
#include "node_text.h"
|
#include "node_text.h"
|
||||||
#include "node_progress_bar.h"
|
#include "node_progress_bar.h"
|
||||||
|
#include "node_dialog_picker.h"
|
||||||
|
|
||||||
using namespace ui;
|
using namespace ui;
|
||||||
|
|
||||||
@@ -219,9 +220,11 @@ void App::init_sidebar()
|
|||||||
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-color"))
|
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-color"))
|
||||||
{
|
{
|
||||||
button->on_click = [this, button](Node*) {
|
button->on_click = [this, button](Node*) {
|
||||||
panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
|
// panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
|
||||||
panels->fix_scroll();
|
// panels->fix_scroll();
|
||||||
button->set_color(panels->get_child_index(color.get()) == -1 ? color_button_normal : color_button_hlight);
|
// 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"))
|
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-layer"))
|
||||||
|
|||||||
@@ -907,7 +907,7 @@ void ui::Canvas::export_equirectangular_thread(std::string file_path)
|
|||||||
m_tmp[i].clear({ 1, 1, 1, 1 });
|
m_tmp[i].clear({ 1, 1, 1, 1 });
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0); // TODO: maybe remove this line
|
glActiveTexture(GL_TEXTURE0); // TODO: maybe remove this line
|
||||||
m_sampler.bind(0);
|
m_sampler_mask.bind(0);
|
||||||
for (auto layer_index : m_order)
|
for (auto layer_index : m_order)
|
||||||
{
|
{
|
||||||
ShaderManager::u_float(kShaderUniform::Alpha, m_layers[layer_index].m_opacity);
|
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_plane.draw_fill();
|
||||||
m_layers[layer_index].m_rtt[i].unbindTexture();
|
m_layers[layer_index].m_rtt[i].unbindTexture();
|
||||||
}
|
}
|
||||||
m_sampler.unbind();
|
m_sampler_mask.unbind();
|
||||||
|
|
||||||
// copy result to cubemap
|
// copy result to cubemap
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
|
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_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
|
||||||
ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
|
ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
|
glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id);
|
||||||
m_sampler.bind(0);
|
m_sampler_mask.bind(0);
|
||||||
m_plane.draw_fill();
|
m_plane.draw_fill();
|
||||||
m_sampler.unbind();
|
m_sampler_mask.unbind();
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
||||||
m_latlong.unbindFramebuffer();
|
m_latlong.unbindFramebuffer();
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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_value = glm::vec2(hsv.y, 1.f - hsv.z);
|
||||||
m_quad->m_color = glm::vec4(rgb, 1);
|
m_quad->m_color = glm::vec4(rgb, 1);
|
||||||
m_cursor = m_quad->m_value;
|
m_cursor = m_quad->m_value;
|
||||||
|
m_base_color = glm::vec4(rgb, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodePanelColor::added(Node* parent)
|
void NodePanelColor::added(Node* parent)
|
||||||
|
|||||||
Reference in New Issue
Block a user