fix high dpi presets panel size
This commit is contained in:
@@ -282,7 +282,7 @@ void NodePanelStroke::init_controls()
|
|||||||
tick->SetSize(16, 32);
|
tick->SetSize(16, 32);
|
||||||
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
||||||
tick->set_image("data/ui/popup-tick.png");
|
tick->set_image("data/ui/popup-tick.png");
|
||||||
float hh = m_presets_popup->m_container->m_children.size() > 10 ? App::I.height * .75f : 400.f;
|
float hh = m_presets_popup->m_container->m_children.size() > 10 ? App::I.height / App::I.zoom * .75f : 400.f;
|
||||||
m_presets_popup->SetSize(300, glm::max(hh, 400.f));
|
m_presets_popup->SetSize(300, glm::max(hh, 400.f));
|
||||||
root()->update();
|
root()->update();
|
||||||
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
||||||
|
|||||||
@@ -246,11 +246,8 @@ void NodeStrokePreview::draw_stroke()
|
|||||||
|
|
||||||
const auto& b = m_brush;
|
const auto& b = m_brush;
|
||||||
|
|
||||||
float w = m_size.x * App::I.zoom;
|
|
||||||
float h = m_size.y * App::I.zoom;
|
|
||||||
|
|
||||||
m_stroke.m_filter_points = false;
|
m_stroke.m_filter_points = false;
|
||||||
m_stroke.m_max_size = h * .75f;
|
m_stroke.m_max_size = m_size.y * .75f;
|
||||||
m_stroke.m_camera.fov = Canvas::I->m_cam_fov;
|
m_stroke.m_camera.fov = Canvas::I->m_cam_fov;
|
||||||
m_stroke.m_camera.rot = Canvas::I->m_cam_rot;
|
m_stroke.m_camera.rot = Canvas::I->m_cam_rot;
|
||||||
m_stroke.reset(true);
|
m_stroke.reset(true);
|
||||||
@@ -289,6 +286,8 @@ void NodeStrokePreview::draw_stroke()
|
|||||||
float pad = glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, 10.f);
|
float pad = glm::max(glm::min(m_stroke.m_max_size, m_brush->m_tip_size) / 2.f, 10.f);
|
||||||
if (b->m_tip_size_pressure)
|
if (b->m_tip_size_pressure)
|
||||||
pad = 10.f;
|
pad = 10.f;
|
||||||
|
float w = m_size.x * App::I.zoom;
|
||||||
|
float h = m_size.y * App::I.zoom;
|
||||||
std::vector<glm::vec2> kp = {
|
std::vector<glm::vec2> kp = {
|
||||||
{ pad, h / 2.f },
|
{ pad, h / 2.f },
|
||||||
{ w / 2.f, 0 },
|
{ w / 2.f, 0 },
|
||||||
|
|||||||
Reference in New Issue
Block a user