[Bf-blender-cvs] [e4726462823] master: Fix T65080: handle case when View2D has 0 scale

Jacques Lucke noreply at git.blender.org
Mon May 27 17:15:34 CEST 2019


Commit: e4726462823d7e5554239a60f744a6e3f4b6cdde
Author: Jacques Lucke
Date:   Mon May 27 17:15:10 2019 +0200
Branches: master
https://developer.blender.org/rBe4726462823d7e5554239a60f744a6e3f4b6cdde

Fix T65080: handle case when View2D has 0 scale

===================================================================

M	source/blender/editors/interface/view2d_draw.c

===================================================================

diff --git a/source/blender/editors/interface/view2d_draw.c b/source/blender/editors/interface/view2d_draw.c
index 2009bbecebc..43b49825219 100644
--- a/source/blender/editors/interface/view2d_draw.c
+++ b/source/blender/editors/interface/view2d_draw.c
@@ -267,6 +267,10 @@ static void draw_horizontal_scale_indicators(const ARegion *ar,
                                              void *to_string_data,
                                              int colorid)
 {
+  if (UI_view2d_scale_get_x(v2d) <= 0.0f) {
+    return;
+  }
+
   GPU_matrix_push_projection();
   wmOrtho2_region_pixelspace(ar);
 
@@ -318,6 +322,10 @@ static void draw_vertical_scale_indicators(const ARegion *ar,
                                            void *to_string_data,
                                            int colorid)
 {
+  if (UI_view2d_scale_get_y(v2d) <= 0.0f) {
+    return;
+  }
+
   GPU_matrix_push_projection();
   wmOrtho2_region_pixelspace(ar);



More information about the Bf-blender-cvs mailing list