Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-19 11:55:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-19 11:55:48 +0400
commit1dad9bf0bcf0ed94d6542088f1e217f29540ec8c (patch)
treec35a4772defd8d16c645473be5d28546cfa4c980 /source/blender/editors/space_view3d
parent31d3e8d2142ad19e0d43cfcce3f1aece55c5d86c (diff)
change window_to_3d to take screen coords as floats.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 2bd2e4e497f..5e2b9fd5e3f 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1074,7 +1074,7 @@ static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my)
float tvec[3];
float tpos[3];
float new_dist;
- short vb[2], mouseloc[2];
+ int vb[2], mouseloc[2];
mouseloc[0]= mx - ar->winrct.xmin;
mouseloc[1]= my - ar->winrct.ymin;
@@ -1087,7 +1087,7 @@ static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my)
/* Project cursor position into 3D space */
initgrabz(rv3d, tpos[0], tpos[1], tpos[2]);
- window_to_3d_delta(ar, dvec, mouseloc[0]-vb[0]/2, mouseloc[1]-vb[1]/2);
+ window_to_3d_delta(ar, dvec, mouseloc[0]-vb[0]/2.0f, mouseloc[1]-vb[1]/2.0f);
/* Calculate view target position for dolly */
add_v3_v3v3(tvec, tpos, dvec);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 0e6ac2d9f04..dc8979e0bf3 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -598,7 +598,7 @@ int initgrabz(RegionView3D *rv3d, float x, float y, float z)
return flip;
}
-void window_to_3d(ARegion *ar, float out[3], const float depth_pt[3], const int mx, const int my)
+void window_to_3d(ARegion *ar, float out[3], const float depth_pt[3], const float mx, const float my)
{
RegionView3D *rv3d= ar->regiondata;
@@ -630,7 +630,7 @@ void window_to_3d(ARegion *ar, float out[3], const float depth_pt[3], const int
/* always call initgrabz */
/* only to detect delta motion */
-void window_to_3d_delta(ARegion *ar, float out[3], const int mx, const int my)
+void window_to_3d_delta(ARegion *ar, float out[3], const float mx, const float my)
{
RegionView3D *rv3d= ar->regiondata;
float dx, dy;
@@ -646,7 +646,7 @@ void window_to_3d_delta(ARegion *ar, float out[3], const int mx, const int my)
/* doesn't rely on initgrabz */
/* for perspective view, get the vector direction to
* the mouse cursor as a normalized vector */
-void window_to_3d_vector(ARegion *ar, float out[3], const int mx, const int my)
+void window_to_3d_vector(ARegion *ar, float out[3], const float mx, const float my)
{
RegionView3D *rv3d= ar->regiondata;