[Bf-blender-cvs] [efb19da3e86] gsoc-2018-many-light-sampling: 3D View: add pixelsize function w/o UI scale
Campbell Barton
noreply at git.blender.org
Fri Jun 1 16:17:34 CEST 2018
Commit: efb19da3e86e9b93845d466aa90d55d301def9c1
Author: Campbell Barton
Date: Fri May 25 10:00:33 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rBefb19da3e86e9b93845d466aa90d55d301def9c1
3D View: add pixelsize function w/o UI scale
===================================================================
M source/blender/editors/include/ED_view3d.h
M source/blender/editors/space_view3d/view3d_project.c
===================================================================
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 2767e041627..aeb1ccfd28a 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -216,6 +216,7 @@ eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *ar, const fl
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *ar, const float co[3], float r_co[2], const eV3DProjTest flag);
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3]);
+float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3]);
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip);
bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 2e876bc48b3..a9a8150c91d 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -283,6 +283,11 @@ float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3])
return mul_project_m4_v3_zfac((float(*)[4])rv3d->persmat, co) * rv3d->pixsize * U.pixelsize;
}
+float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[3])
+{
+ return mul_project_m4_v3_zfac((float(*)[4])rv3d->persmat, co) * rv3d->pixsize;
+}
+
/**
* Calculate a depth value from \a co, use with #ED_view3d_win_to_delta
*/
More information about the Bf-blender-cvs
mailing list