我正在编写一个使用形状画笔通过矩阵函数进行绘制的绘图程序。除了一点都不顺畅之外,一切都运行良好。如果鼠标高速移动,画中会有空隙。
我到处寻找,但找不到任何解决方案。
代码基本上是这样的:
//Press mouse within container. Uses Matrix to draw instances of the brush.
private function handleMouseDown_drawContainer(e:MouseEvent):void
{
_matrix.identity();
_matrix.translate(mouseX - 10, mouseY - 30);
_layout.bitmapData.draw(_layout.brush, _matrix);
_layout.drawContainer.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove_drawContainer);
_layout.drawContainer.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp_drawContainer)
}
//Move mouse within container. Uses Matrix to draw instances of the brush.
private function handleMouseMove_drawContainer(e:MouseEvent):void
{
_matrix.identity();
_matrix.translate(mouseX - 10, mouseY - 30);
_layout.bitmapData.draw(_layout.brush, _matrix);
}
如果有人能帮我弄清楚如何平滑绘图,我将永远感激不尽!=p
提前致谢。