diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-08-09 20:20:11 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-08-09 20:20:11 (GMT) |
commit | 32f1efac907dc00b6f7e83eea1e85a528f9b9937 (patch) | |
tree | 70c9ea8a72e49a1b300b61ae3ee18f39becca2ba /tksao | |
parent | 0a0065f5ab3911d94e144b38c275f1387d62057d (diff) | |
download | blt-32f1efac907dc00b6f7e83eea1e85a528f9b9937.zip blt-32f1efac907dc00b6f7e83eea1e85a528f9b9937.tar.gz blt-32f1efac907dc00b6f7e83eea1e85a528f9b9937.tar.bz2 |
simplify code
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/frcommand.C | 9 | ||||
-rw-r--r-- | tksao/widget/widget.C | 5 | ||||
-rw-r--r-- | tksao/widget/widget.h | 1 |
3 files changed, 4 insertions, 11 deletions
diff --git a/tksao/frame/frcommand.C b/tksao/frame/frcommand.C index 306be4c..009dac5 100644 --- a/tksao/frame/frcommand.C +++ b/tksao/frame/frcommand.C @@ -341,15 +341,14 @@ void FrameBase::panBBoxCmd(const Vector& vv) void FrameBase::panBeginCmd(const Vector& vv) { - // vv and panCursor are in CANVAS coords - panCursor = cursor; - panStart = vv; + // vv is in CANVAS coords + panStart = mapToRef(vv,Coord::CANVAS); } void FrameBase::panMotionCmd(const Vector& vv) { - Vector dd = vv -panStart; - cursor = panCursor + Vector(-dd[0],dd[1]); + // vv is in CANVAS coords + cursor -= mapToRef(vv,Coord::CANVAS) - panStart; setBinCursor(); update(MATRIX); diff --git a/tksao/widget/widget.C b/tksao/widget/widget.C index 5427f64..05117c1 100644 --- a/tksao/widget/widget.C +++ b/tksao/widget/widget.C @@ -530,11 +530,6 @@ void Widget::redrawNow(BBox bb) Tcl_DoOneEvent(TCL_IDLE_EVENTS); } -void Widget::forceUpdate() -{ - Tcl_DoOneEvent(TCL_IDLE_EVENTS); -} - // Update Bounding Box. For image at (n,n) with size (m,m), // bbox is defined from (n,n) to (n+m,n+m) diff --git a/tksao/widget/widget.h b/tksao/widget/widget.h index d697d82..01549ba 100644 --- a/tksao/widget/widget.h +++ b/tksao/widget/widget.h @@ -141,7 +141,6 @@ class Widget { void redraw(BBox); // ping tk to redraw this bbox void redrawNow(); // force update now this widget void redrawNow(BBox); // force update now this bbox - void forceUpdate(); // only force update virtual int parse(istringstream&) =0; // parse subcommands |