Hello,

you can reproduce the bug with the follow steps:

  - new segment
  - open in matrix (or notation) editor
  - add a control ruler (i.e. volume controller)
  - add a point before the start (it works!?)

Idem with a control-line (shift + click).

The attached patch fixes the problem.


P.S.  there are other two bug fixes here:

    http://sourceforge.net/p/rosegarden/bugs/1427
    http://sourceforge.net/p/rosegarden/bugs/1417

but no hurry, it's only a memo.
Index: src/gui/rulers/ControlPainter.cpp
===================================================================
--- src/gui/rulers/ControlPainter.cpp   (revision 14088)
+++ src/gui/rulers/ControlPainter.cpp   (working copy)
@@ -57,6 +57,16 @@
 void
 ControlPainter::handleLeftButtonPress(const ControlMouseEvent *e)
 {
+    float xmin = m_ruler->getXMin();
+    float xmax = m_ruler->getXMax();
+    float x = e->x;
+
+    if (x < xmin) {
+        x = xmin;
+    } else if (x > xmax) {
+        x = xmax;
+    }
+
     if (e->itemList.size()) {
         ControllerEventsRuler *ruler = static_cast <ControllerEventsRuler*> 
(m_ruler);
         std::vector <ControlItem*>::const_iterator it = e->itemList.begin();
@@ -84,13 +94,13 @@
                 if (m_controlLineOrigin.first != -1 && 
m_controlLineOrigin.second != -1) {
                     ruler->addControlLine(m_controlLineOrigin.first,
                                           m_controlLineOrigin.second,
-                                          e->x,
+                                          x,
                                           e->y,
                                           eraseExistingControllers);
                 }
             } else {
 
-                ControlItem *item = ruler->addControlItem(e->x,e->y);
+                ControlItem *item = ruler->addControlItem(x,e->y);
                 ControlMouseEvent *newevent = new ControlMouseEvent(e);
                 newevent->itemList.push_back(item);
                 m_overItem = true;
@@ -98,7 +108,7 @@
             }
 
             // Save these coordinates for next time
-            m_controlLineOrigin.first = e->x;
+            m_controlLineOrigin.first = x;
             m_controlLineOrigin.second = e->y;
         }
     }
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to