我有我的代码的这部分,我只需要它在相反的方向弯曲。它创建一条从一个点到向上弯曲的鼠标的线。我需要它向下弯曲。我会改变什么价值观来做到这一点?
if ((mouseX-targetPointX<0 && mouseY-targetPointY>0) || (mouseX-targetPointX>=0 && mouseY-targetPointY<=0))
{
if (mouseY-targetPointY>0)
{
line.moveTo(mouseX-offset,mouseY-offset);
line.curveTo(mouseX-offset,targetPointY-offset,targetPointX-offset,targetPointY-offset);
line.lineTo(targetPointX+offset,targetPointY+offset);
line.curveTo(mouseX+offset,targetPointY+offset,mouseX+offset,mouseY+offset);
}
else
{
line.moveTo(mouseX-offset,mouseY-offset);
line.curveTo(targetPointX-offset,mouseY-offset,targetPointX-offset,targetPointY-offset);
line.lineTo(targetPointX+offset,targetPointY+offset);
line.curveTo(targetPointX+offset,mouseY+offset,mouseX+offset,mouseY+offset);
}
}
else
{
if (mouseX<targetPointX && mouseY<targetPointY)
{
line.moveTo(mouseX-offset,mouseY+offset);
line.curveTo(targetPointX-offset,mouseY+offset,targetPointX-offset,targetPointY+offset);
line.lineTo(targetPointX+offset,targetPointY-offset);
line.curveTo(targetPointX+offset,mouseY-offset,mouseX+offset,mouseY-offset);
}
else
{
line.moveTo(mouseX-offset,mouseY+offset);
line.curveTo(mouseX-offset,targetPointY+offset,targetPointX-offset,targetPointY+offset);
line.lineTo(targetPointX+offset,targetPointY-offset);
line.curveTo(mouseX+offset,targetPointY-offset,mouseX+offset,mouseY-offset);
}
}
line.endFill();
}
}