Skip to content
Snippets Groups Projects

support for two-colored lines in canvas

Merged Max Lyon requested to merge ml/two_colored_lines_canvas into develop
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
444 if (l.pick_id >= 0)
445 has_picker = true;
446 }
447
448 // TODO: screen space dash size
449 if (!m.vertices().empty())
450 {
451 if (_state.two_colored_lines)
452 glow::warning() << "screen space two-colored lines are not supported";
453
454 auto r = gv::make_and_configure_renderable(gv::lines(pos).line_width_px(size), color3);
455 415
456 if (has_picker)
457 attach_picker(r, edge_pick_ids_data);
416 // two common functions for lines_px and lines_world:
417 auto add_line_to_mesh = [&](auto l, bool& has_picker, bool& has_normals)
  • 416 // two common functions for lines_px and lines_world:
    417 auto add_line_to_mesh = [&](auto l, bool& has_picker, bool& has_normals)
    418 {
    419 auto v0 = m.vertices().add();
    420 auto v1 = m.vertices().add();
    421 pos[v0] = l.p0.pos;
    422 pos[v1] = l.p1.pos;
    423 color3[v0] = tg::color3(l.p0.color);
    424 color3[v1] = tg::color3(l.p1.color);
    425 color4[v0] = tg::color4(l.p0.color);
    426 color4[v1] = tg::color4(l.p1.color);
    427 size[v0] = l.p0.size;
    428 size[v1] = l.p1.size;
    429 normals[v0] = l.p0.normal;
    430 normals[v1] = l.p1.normal;
    431 has_normals |= tg::length_sqr(normals[v0]) + tg::length_sqr(normals[v1]) > 0;
  • Max Lyon added 1 commit

    added 1 commit

    • 2520d191 - use more constexpr for better performance

    Compare with previous version

  • Author Developer

    Both comments above should be addressed now.

  • Philip Trettner mentioned in commit 7eba16d0

    mentioned in commit 7eba16d0

  • Please register or sign in to reply
    Loading