rewrite CurveWidget::mousePressEvent() to make it more clear, fix a major bug (middle click was not intercepted soon enough), and optimize CurveWidget::mousePressEvent() and CurveWidget::mouseMoveEvent() (updateGL() was called almost every time)
optimize mouseRelease