首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Konvajs集团突出边境

Konvajs集团突出边境
EN

Stack Overflow用户
提问于 2016-10-13 19:33:50
回答 1查看 1.1K关注 0票数 0

我有两个小组与圆圈或矩形在每组内。我需要在单击时突出显示该组,并设置一个边框,以便用户知道哪个组处于活动状态。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-14 02:04:48

有很多方法可以做到这一点。例如:

代码语言:javascript
复制
group.on('click', () => {
  // toggle selected, this is just our custom property
  group.isSelected = !group.isSelected;
  // hide or show selection box
  selectionRect.visible(group.isSelected);
  // set box size and position
  selectionRect.setAttrs(group.getClientRect()); 
  layer.draw();
})

演示:http://jsbin.com/nucopakijo/1/edit?html,js,output

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40029453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档