滚动时如何重绘 degrafa 背景?
我使用的是具有 degrafa 背景的画布,到目前为止一切顺利。
但是,滚动时,背景(degrafa 网格)不会重新绘制。 在代码中,背景笔画链接到容器高度。 即使滚动,容器高度也不会改变。
如何获取整个区域的高度,以便为我的 degrafa 背景设置新的高度?
它看起来像这样:
<mx:Canvas id="blackBoard"
width="100%"
height="100%"
x="0"
y="0"
backgroundColor="#444444"
clipContent="true">
<!-- Degrafa Surface -->
<degrafa:Surface id="boardSurfaceContainer">
<degrafa:strokes>
<degrafa:SolidStroke id="whiteStroke"
color="#EEE"
weight="1"
alpha=".2"/>
</degrafa:strokes>
<!-- Grid drawing -->
<degrafa:GeometryGroup id="grid">
<degrafa:VerticalLineRepeater count="{blackBoard.width / ApplicationFacade.settings.GRID_SIZE}"
stroke="{whiteStroke}"
x="0"
y="0"
y1="{blackBoard.height}"
offsetX="0"
offsetY="0"
moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}"
moveOffsetY="0"/>
<degrafa:HorizontalLineRepeater count="{blackBoard.height / ApplicationFacade.settings.GRID_SIZE}"
stroke="{whiteStroke}"
x="0"
y="0"
x1="{blackBoard.width}"
offsetX="0"
offsetY="0"
moveOffsetX="0"
moveOffsetY="{ApplicationFacade.settings.GRID_SIZE}"/>
</degrafa:GeometryGroup>
</degrafa:Surface>
I am using a canvas which has a degrafa background, so far so good.
However, when scrolling, the background (degrafa grid) does not get redrawn.
In the code the background strokes are linked to the container height. The container height does not change even when scrolling.
How do I get the height of the whole area so I can set the new height to my degrafa background?
It looks like this:
<mx:Canvas id="blackBoard"
width="100%"
height="100%"
x="0"
y="0"
backgroundColor="#444444"
clipContent="true">
<!-- Degrafa Surface -->
<degrafa:Surface id="boardSurfaceContainer">
<degrafa:strokes>
<degrafa:SolidStroke id="whiteStroke"
color="#EEE"
weight="1"
alpha=".2"/>
</degrafa:strokes>
<!-- Grid drawing -->
<degrafa:GeometryGroup id="grid">
<degrafa:VerticalLineRepeater count="{blackBoard.width / ApplicationFacade.settings.GRID_SIZE}"
stroke="{whiteStroke}"
x="0"
y="0"
y1="{blackBoard.height}"
offsetX="0"
offsetY="0"
moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}"
moveOffsetY="0"/>
<degrafa:HorizontalLineRepeater count="{blackBoard.height / ApplicationFacade.settings.GRID_SIZE}"
stroke="{whiteStroke}"
x="0"
y="0"
x1="{blackBoard.width}"
offsetX="0"
offsetY="0"
moveOffsetX="0"
moveOffsetY="{ApplicationFacade.settings.GRID_SIZE}"/>
</degrafa:GeometryGroup>
</degrafa:Surface>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只需使用 degrafa 属性绑定中的滚动位置
I just had to use the scroll position in the degrafa property binding