From f32ccec154b2672dc5d601e3706cde2fab31af41 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 15 Nov 2025 08:25:27 -0600 Subject: [PATCH] Fix #7364: If you change the width/height of a drawing camera it doesn't scale the text decoration. --- src/bonsai/bonsai/bim/module/drawing/decoration.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/decoration.py b/src/bonsai/bonsai/bim/module/drawing/decoration.py index 6251cf1c87..edc51eb231 100644 --- a/src/bonsai/bonsai/bim/module/drawing/decoration.py +++ b/src/bonsai/bonsai/bim/module/drawing/decoration.py @@ -172,16 +172,12 @@ class BaseDecorator: def get_camera_width_mm(self): # Horrific prototype code to ensure bgl draws at drawing scales # https://blender.stackexchange.com/questions/16493/is-there-a-way-to-fit-the-viewport-to-the-current-field-of-view - def is_landscape(render): - return render.resolution_x > render.resolution_y - camera = bpy.context.scene.camera render = bpy.context.scene.render - if is_landscape(render): - camera_width_model = camera.data.ortho_scale - else: - camera_width_model = camera.data.ortho_scale / render.resolution_y * render.resolution_x - + + # Always use the camera's ortho_scale as the width in model space + camera_width_model = camera.data.ortho_scale + scale = tool.Drawing.get_scale_ratio(tool.Drawing.get_diagram_scale(camera)["Scale"]) camera_width_mm = scale * camera_width_model return camera_width_mm