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-07-21 05:30:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-21 05:30:26 +0400
commit98774eba0e459faf801d5be4bed3588b75166a1b (patch)
tree870566da7a5477b997210a3f6c86724ed74b9ba8 /source/blender/editors/space_view3d/drawobject.c
parent28780342eddb0e1e767bf64d69cb99bd138d621f (diff)
fix [#28037] Missing orange selection lines (trivial)
From what I can tell there is no good fix for this bug, calculating the 2d/3d viewborder and then attempting to align them to be pixel perfect fails because of float imprecision. Added a workaround, so the camera border is always drawn in 2d space, since this workaround may cause problems later on its kept under the define VIEW3D_CAMERA_BORDER_HACK so we can get old behavior back easily.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index e314d249e6d..e6889f4563f 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1335,6 +1335,11 @@ static void draw_focus_cross(float dist, float size)
glEnd();
}
+#ifdef VIEW3D_CAMERA_BORDER_HACK
+float view3d_camera_border_hack_col[4];
+short view3d_camera_border_hack_test= FALSE;
+#endif
+
/* flag similar to draw_object() */
static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int flag)
{
@@ -1348,7 +1353,15 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
const float scax= 1.0f / len_v3(ob->obmat[0]);
const float scay= 1.0f / len_v3(ob->obmat[1]);
const float scaz= 1.0f / len_v3(ob->obmat[2]);
-
+
+#ifdef VIEW3D_CAMERA_BORDER_HACK
+ if(is_view && !(G.f & G_PICKSEL)) {
+ glGetFloatv(GL_CURRENT_COLOR, view3d_camera_border_hack_col);
+ view3d_camera_border_hack_test= TRUE;
+ return;
+ }
+#endif
+
cam= ob->data;
aspx= (float) scene->r.xsch*scene->r.xasp;
aspy= (float) scene->r.ysch*scene->r.yasp;