]> sigrok.org Git - pulseview.git/blobdiff - pv/view/cursorpair.cpp
TimeMarker: Align to a integer pixel offset
[pulseview.git] / pv / view / cursorpair.cpp
index e2c80833f2503631814a5ee1888f1088af13da69..24d036652d763ca6d9a4be898a2cdcbeedd35020 100644 (file)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "cursorpair.hpp"
 
+#include "pv/util.hpp"
 #include "ruler.hpp"
 #include "view.hpp"
-#include "pv/util.hpp"
 
-#include <cassert>
 #include <algorithm>
+#include <cassert>
 
 using std::max;
 using std::make_pair;
@@ -188,9 +187,7 @@ pair<float, float> CursorPair::get_cursor_offsets() const
        assert(first_);
        assert(second_);
 
-       return pair<float, float>(
-               ((first_->time() - view_.offset()) / view_.scale()).convert_to<float>(),
-               ((second_->time() - view_.offset()) / view_.scale()).convert_to<float>());
+       return pair<float, float>(first_->get_x(), second_->get_x());
 }
 
 } // namespace TraceView