From 8a05a9ee94b23844bf2ffbd01afc4adddc6379db Mon Sep 17 00:00:00 2001 From: Markus Roth Date: Sun, 11 Mar 2012 18:46:14 -0700 Subject: [PATCH] Skip step frames right away instead of iterating through all intermediate frames. --- sloth/core/labeltool.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index d7ac801..d1a0b9a 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -296,26 +296,18 @@ class LabelTool(QObject): def gotoNext(self, step=1): if self._model is not None: if self._current_image is not None: - next_image = self._current_image.getNextSibling() + next_image = self._current_image.getNextSibling(step) else: next_image = self._model.iterator(ImageModelItem).next() - - # step multiple images/frames if step > 1 - for s in range(step-1): if next_image is not None: - next_image = next_image.getNextSibling() + next_image = next_image.getNextSibling(step-1) if next_image is not None: self.setCurrentImage(next_image) - + def gotoPrevious(self, step=1): if self._model is not None and self._current_image is not None: - prev_image = self._current_image.getPreviousSibling() - - # step multiple images/frames if step > 1 - for s in range(step-1): - if prev_image is not None: - prev_image = prev_image.getPreviousSibling() + prev_image = self._current_image.getPreviousSibling(step) if prev_image is not None: self.setCurrentImage(prev_image)