如何绘制和删除画布图形,我有处理鼠标悬停在图形上的方法,因此当用户将鼠标悬停在图形上时,我需要使用画布绘制框,但是当用户完成悬停时,我需要隐藏此框,如何我做到了。
protected _handleMouseHover(gesture: Gesture, event: WindowEvent) {
switch (gesture.state) {
case GestureState.STARTED:
case GestureState.CONTINUED:
this.drawBox();
break;
case GestureState.FINISHED:
break;
}
}
现在当我将鼠标悬停在绘图上时,它将继续绘制框多次