Revision: 40711
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40711&view=rev
Author:   bob1961
Date:     2010-09-27 19:13:53 +0000 (Mon, 27 Sep 2010)

Log Message:
-----------
Modify Ged::pane_mouse_ray and Ged::pane_mouse_3dpoint to honor snap-to-grid if 
it's on.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/lib/Ged.tcl

Modified: brlcad/trunk/src/tclscripts/lib/Ged.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/lib/Ged.tcl     2010-09-27 18:55:34 UTC (rev 
40710)
+++ brlcad/trunk/src/tclscripts/lib/Ged.tcl     2010-09-27 19:13:53 UTC (rev 
40711)
@@ -617,6 +617,7 @@
        variable mLastDataType ""
        variable mLastDataIndex ""
        variable mLastMouseRayPos ""
+       variable mLastMouseRayTarget ""
        variable mLastMousePos ""
        variable mBegin3DPoint ""
        variable mMiddle3DPoint ""
@@ -2777,6 +2778,7 @@
        return
     }
 
+    set mLastMouseRayTarget ""
     refresh_off
     $mGed $mLastDataType $itk_component($_pane) draw 0
     set point [eval pane_mouse_3dpoint $_pane $mLastMousePos 0]
@@ -3175,18 +3177,13 @@
        set partitions [pane_mouse_ray $_pane $_x $_y 1]
 
        if {$partitions == ""} {
+           set point $mLastMouseRayTarget
+
            if {!$_vflag} {
-               return
+               return $point
            }
 
            set mMeasuringStick3DCurrent 0
-
-           refresh_off
-           set saved_center [$mGed center $itk_component($_pane)]
-           eval $mGed vslew $itk_component($_pane) $mLastMouseRayPos
-           set point [vscale [$mGed center $itk_component($_pane)] [$mGed 
local2base $itk_component($_pane)]]
-           $mGed center $itk_component($_pane) $saved_center
-           refresh_on
        } else {
            set partition [lindex $partitions 0]
 
@@ -3252,15 +3249,15 @@
 ::itcl::body cadwidgets::Ged::pane_mouse_ray {_pane _x _y {_pflag 0}} {
     set mLastMouseRayPos "$_x $_y"
 
-    set target [$mGed screen2model $itk_component($_pane) $_x $_y]
     set view [$mGed screen2view $itk_component($_pane) $_x $_y]
+    set view [$mGed snap_view $itk_component($_pane) [lindex $view 0] [lindex 
$view 1]]
 
     set bounds [$mGed bounds $itk_component($_pane)]
     set vZ [expr {[lindex $bounds 4] / -2048.0}]
     set start [$mGed v2m_point $itk_component($_pane) [lindex $view 0] [lindex 
$view 1] $vZ]
+    set mLastMouseRayTarget [$mGed v2m_point $itk_component($_pane) [lindex 
$view 0] [lindex $view 1] 0]
 
-
-    if {[catch {shoot_ray $start "at" $target 1 1 0} partitions]} {
+    if {[catch {shoot_ray $start "at" $mLastMouseRayTarget 1 1 0} partitions]} 
{
        return $partitions
     }
 
@@ -3280,7 +3277,7 @@
        }
     } else {
        foreach callback $mMouseRayCallbacks {
-           catch {$callback $start $target $partitions}
+           catch {$callback $start $mLastMouseRayTarget $partitions}
        }
     }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to