antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

[Bug]: WebGL engine rendering error #6765

hh1412 posted onGitHub

Describe the bug / 问题描述

在官网中使用webGL引擎 点击节点 节点应该渲染选中的状态 但是有时候渲染出来的效果是错的 https://g6.antv.antgroup.com/examples/behavior/select/#click 代码 import { Graph } from '@antv/g6'; import { Renderer as WebGLRenderer } from '@antv/g-webgl' const data = { nodes: [ { id: 'node1', style: { x: 150, y: 250 } }, { id: 'node2', style: { x: 350, y: 250 } }, { id: 'node3', style: { x: 250, y: 250 } }, ], edges: [], };

const graph = new Graph({ data, renderer: () => new WebGLRenderer(), behaviors: [{ type: 'click-select', multiple: true, trigger: ['shift'] }, 'drag-element'], autoFit: 'center', });

graph.render();

const prompt = document.createElement('div'); prompt.innerHTML = 👉 Press SHIFT to enable multiple selection; prompt.style.position = 'absolute'; const container = document.getElementById('container'); container.appendChild(prompt);

未点击时 Image 点击时 Image 期望的效果 Image

https://g6.antv.antgroup.com/examples/behavior/select/#click

Steps to Reproduce the Bug or Issue / 重现步骤

打开官网https://g6.antv.antgroup.com/examples/behavior/select/#click 将下列代码复制进去

-------------代码分割线---------------- import { Graph } from '@antv/g6'; import { Renderer as WebGLRenderer } from '@antv/g-webgl' const data = { nodes: [ { id: 'node1', style: { x: 150, y: 250 } }, { id: 'node2', style: { x: 350, y: 250 } }, { id: 'node3', style: { x: 250, y: 250 } }, ], edges: [], };

const graph = new Graph({ data, renderer: () => new WebGLRenderer(), behaviors: [{ type: 'click-select', multiple: true, trigger: ['shift'] }, 'drag-element'], autoFit: 'center', });

graph.render();

const prompt = document.createElement('div'); prompt.innerHTML = 👉 Press SHIFT to enable multiple selection; prompt.style.position = 'absolute'; const container = document.getElementById('container'); container.appendChild(prompt); -------------代码分割线----------------

点击节点 就复现了

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

元素为矩形时

未点击时 Image

点击时 Image

posted by hh1412 2 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests