diff options
author | George Vogiatzis <Gvgeo> | 2019-05-04 15:03:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-04 15:11:04 +0300 |
commit | b8d806caf7c904b5489d9e5ed74fcb081379a4ec (patch) | |
tree | 872e13f77ee17edba491c2ff275ef8d39b50b18a /source/blender/draw/engines | |
parent | e474549da5e2a5fa8dc3e80ce01aa8dc08d2f265 (diff) |
UI: Add Look Developer Balls Size option
Note: Some adjustments were made compared to the diff mainly for code
readability and made the default ball size 150px.
Reviewed By: fclem
Differential Revision: http://developer.blender.org/D4793
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lookdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 4be87bf1a5e..13f7ab1c562 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -76,7 +76,11 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, rcti rect; ED_region_visible_rect(draw_ctx->ar, &rect); - const int ball_size = max_ii(BLI_rcti_size_x(&rect) * 0.1f, 100.0f) * U.dpi_fac; + /* Make the viewport width scale the lookdev balls a bit. + * Scale between 1000px and 2000px. */ + const float viewport_scale = clamp_f( + BLI_rcti_size_x(&rect) / (2000.0f * U.dpi_fac), 0.5f, 1.0f); + const int ball_size = U.lookdev_ball_size * U.dpi_fac * viewport_scale; if (ball_size != effects->ball_size || rect.xmax != effects->anchor[0] || rect.ymin != effects->anchor[1]) { |