Improve HiDPI awareness of Blender logo

This commit is contained in:
2018-08-06 11:45:44 +02:00
parent e8844bc0ec
commit 49d0569c6b
2 changed files with 11 additions and 2 deletions

View File

@@ -182,10 +182,19 @@ def benchmark_draw_post_pixel(arg1, arg2):
draw_rect(bottom_x, bottom_y, bottom_w, bottom_h, bottom_color)
# Logo
# TODO(sergey): Make it DPI aware.
logo_width_unscaled = 524
logo_height_unscaled = 152
logo_dir = os.path.dirname(os.path.abspath(__file__))
logo_filepath = os.path.join(logo_dir, 'blender.png')
draw_image(logo_filepath, 12, (bottom_h - 24) / 2, 85, 24)
logo_scale_factor = 1.0
while logo_height_unscaled * logo_scale_factor > bottom_h:
logo_scale_factor *= 0.5
logo_width = logo_width_unscaled * logo_scale_factor
logo_height = logo_height_unscaled * logo_scale_factor
logo_padding = (bottom_h - logo_height) * 0.5
draw_image(logo_filepath,
logo_padding, logo_padding,
logo_width, logo_height)
handle_draw = bpy.types.SpaceBenchmark.draw_handler_add(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 30 KiB