summaryrefslogtreecommitdiff
path: root/gtk2_ardour/crossfade_edit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/crossfade_edit.cc')
-rw-r--r--gtk2_ardour/crossfade_edit.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc
index c1201f2f9a..726194c41b 100644
--- a/gtk2_ardour/crossfade_edit.cc
+++ b/gtk2_ardour/crossfade_edit.cc
@@ -497,6 +497,18 @@ CrossfadeEditor::add_control_point (double x, double y)
void
CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfract)
{
+ if ( xfract < 0.0 ) {
+ xfract = 0.0;
+ } else if ( xfract > 1.0 ) {
+ xfract = 1.0;
+ }
+
+ if ( yfract < 0.0 ) {
+ yfract = 0.0;
+ } else if ( yfract > 1.0 ) {
+ yfract = 1.0;
+ }
+
const double half_size = rint(size/2.0);
double x1 = nx - half_size;
double x2 = nx + half_size;