prevent infinite loop when calculating tick marks on low zoom levels
authorRobin Gareus <robin@gareus.org>
Wed, 2 Nov 2016 16:54:24 +0000 (17:54 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 2 Nov 2016 16:54:24 +0000 (17:54 +0100)
gtk2_ardour/editor_rulers.cc

index 2f12604872bfc54b142b14a68c50667e2aebb558..4424546296e90b06ce8d23f6670bf7dfa22d5c57 100644 (file)
@@ -996,11 +996,11 @@ Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdou
                                 mark.position = pos;
                                 marks.push_back (mark);
                                 ++n;
-                        }
-                        /* can't use Timecode::increment_hours() here because we may be traversing thousands of hours
-                           and doing it 1 hour at a time is just stupid (and slow).
-                        */
-                        timecode.hours += timecode_mark_modulo;
+                       }
+                       /* can't use Timecode::increment_hours() here because we may be traversing thousands of hours
+                        * and doing it 1 hour at a time is just stupid (and slow).
+                        */
+                       timecode.hours += timecode_mark_modulo - (timecode.hours % timecode_mark_modulo);
                }
                break;
        }