From abc0c5d8d150dafcf61aa522d56b2a36ee662229 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 20 Jan 2013 13:58:28 +0200 Subject: [PATCH] Fix elevation mode in Manipulator I didn't get it quite right when converting the input event handling --- source/designer/manipulator.cpp | 6 ++++-- source/designer/manipulator.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/designer/manipulator.cpp b/source/designer/manipulator.cpp index d1e458b..83a093a 100644 --- a/source/designer/manipulator.cpp +++ b/source/designer/manipulator.cpp @@ -48,6 +48,8 @@ void Manipulator::start_elevate() cancel(); mode = ELEVATE; + + elev_origin = pointer.y; } bool Manipulator::start_extend() @@ -361,7 +363,7 @@ void Manipulator::button_press(unsigned btn) } } -void Manipulator::axis_motion(unsigned axis, float value, float change) +void Manipulator::axis_motion(unsigned axis, float value, float) { if(axis==0) pointer.x = value; @@ -428,7 +430,7 @@ void Manipulator::axis_motion(unsigned axis, float value, float change) } else if(mode==ELEVATE && axis==1) { - float dz = -change; + float dz = pointer.y-elev_origin; signal_status.emit(format("Elevation: %+.0fmm (%.0fmm)", dz*1000, (center.z+dz)*1000)); diff --git a/source/designer/manipulator.h b/source/designer/manipulator.h index 469f09f..b4216ee 100644 --- a/source/designer/manipulator.h +++ b/source/designer/manipulator.h @@ -52,6 +52,7 @@ private: R2C2::Vector move_origin; float angle; float rot_origin; + float elev_origin; std::set neighbors; std::vector extend_tracks; -- 2.43.0