fix picking preview
This commit is contained in:
@@ -81,6 +81,9 @@ void CanvasModePen::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
|
|||||||
{
|
{
|
||||||
m_picking = true;
|
m_picking = true;
|
||||||
canvas->pick_start();
|
canvas->pick_start();
|
||||||
|
glm::vec4 pix = canvas->pick_get(loc);
|
||||||
|
canvas->m_current_brush.m_tip_color = pix;
|
||||||
|
App::I.color->set_color(pix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -160,10 +163,10 @@ void CanvasModePen::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
|
|||||||
void CanvasModePen::on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const glm::mat4& camera)
|
void CanvasModePen::on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const glm::mat4& camera)
|
||||||
{
|
{
|
||||||
#ifndef __IOS__
|
#ifndef __IOS__
|
||||||
if (!m_dragging)
|
//if (!m_dragging)
|
||||||
{
|
{
|
||||||
auto pos = m_resizing ? m_size_pos_start : m_cur_pos;
|
auto pos = m_resizing ? m_size_pos_start : m_cur_pos;
|
||||||
if (App::I.keys[(int)kKey::KeyAlt])
|
if (App::I.keys[(int)kKey::KeyAlt] && !m_resizing)
|
||||||
pos.x = pos.x - canvas->m_current_brush.m_tip_size * 500;
|
pos.x = pos.x - canvas->m_current_brush.m_tip_size * 500;
|
||||||
ui::ShaderManager::use(ui::kShader::StrokePreview);
|
ui::ShaderManager::use(ui::kShader::StrokePreview);
|
||||||
ui::ShaderManager::u_int(ui::kShaderUniform::Tex, 0);
|
ui::ShaderManager::u_int(ui::kShaderUniform::Tex, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user