耀斑图拖动问题

发布于 2024-10-12 05:41:59 字数 386 浏览 6 评论 0原文

我使用 Flare 作为我当前 Flex 项目选择的图形库。一切都很好 - 我的图表显示正确,但移动它会出现问题。图表可以移动到应用程序周围的任何位置,甚至可以移动到图表面板/容器之外。它甚至可以放置在按钮和其他 GUI 元素的顶部。

我需要图形保留在其父容器内,只能在其父容器内移动。我花了很多时间尝试其他 Flare/Flex 开发人员推荐的不同方法,但似乎没有任何效果。

我尝试过的一些方法:在图形的父容器上设置矩形边界,将父容器或图形本身放置在精灵对象中并设置特定的边界,以及适当地设置clipToContent属性。

我在网上找到了一些 Flare 演示,每个由节点和顶点表示的图形演示似乎都有同样的问题。这让我觉得这是一个耀斑错误,但我还不想跳到这个结论。

非常感谢任何帮助!谢谢。

I am using Flare as my graphing library of choice for my current Flex project. Everything works great - my graph is being displayed correctly, but moving it poses a problem. The graph can be moved anywhere around the application, even outside of the graph's panel/container. It can even be placed on top of buttons and other GUI elements.

I need the graph to stay within its parent container, only able to move within its parent. I've spent numerous hours trying different approaches recommended by other Flare/Flex developers and nothing seems to work.

Some approaches I've tried: setting rectangular bounds on the graph's parent container, placing the parent container or the graph itself within a sprite object and setting specific bounds, and setting the clipToContent property appropriately.

I've found a few Flare demos online and each of the graph demos that are represented by nodes and vertices seem to have this same issue. This makes me thing that it's a Flare bug, but I don't want to jump to that conclusion yet.

Any help is greatly appreciated! Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

街角迷惘 2024-10-19 05:41:59

我遇到了同样的情况,我通过为我的可视化创建一个掩码解决了这个问题(解决了还是规避了?哈哈):

-->在我的 .mxml 中

<mx:Panel width="65%" height="100%" layout="absolute" id="graphPanel">
  <flexvis:FlareVis id="graph" label="Graph" width="100%" height="100%" />  
  <mx:Canvas width="100%" height="100%" id="graphMask" />
</mx:Panel>

-->在动作脚本中:

var vis:Visualization = graph.visualization;
vis.mask = graphMask;

I faced the same situation, and I solved it by creating a mask for my Visualization(solved or circumvented? lol):

--> in my .mxml

<mx:Panel width="65%" height="100%" layout="absolute" id="graphPanel">
  <flexvis:FlareVis id="graph" label="Graph" width="100%" height="100%" />  
  <mx:Canvas width="100%" height="100%" id="graphMask" />
</mx:Panel>

--> in actionScript:

var vis:Visualization = graph.visualization;
vis.mask = graphMask;
浊酒尽余欢 2024-10-19 05:41:59

有两个不同的问题导致此问题。

1)用于平移和缩放的hitarea。 -> 使用 PanZoomControl 时,定义 hitarea,如 new PanZoomControl(此处指定 hitarea)。有助于解决“鼠标交互超出vis区域导致vis四处移动”的问题;

2)mask控制显示区域。它将帮助定义显示视觉的区域,否则视觉将超出边界。

希望这有帮助:)

There are two different issues causing this problem.

1)hitarea for panning and zoom. ->while using PanZoomControl, define the hitarea,like new PanZoomControl(here to specify the hitarea). It will help to solve the problem "mouse interactive out of the vis area cause the vis moving around";

2)mask to control the display area. It will help define the area to display your vis, or the vis will go out of the boundary.

Hope this helps:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文