From 1094c3f276a3ba207e7a9d132e1e2ea53f0e74ba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 16 Oct 2019 14:06:25 +1100 Subject: RNA: region_to_view took int's instead of floats Internally the function uses float's, RNA exposed args as int's. Python3.8 warns about int/float conversion in toolbar drawing code. --- source/blender/makesrna/intern/rna_screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 728ef3fb706..1637f8cfed5 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -272,7 +272,7 @@ static void rna_Area_ui_type_update(bContext *C, PointerRNA *ptr) sa->butspacetype_subtype = 0; } -static void rna_View2D_region_to_view(struct View2D *v2d, int x, int y, float result[2]) +static void rna_View2D_region_to_view(struct View2D *v2d, float x, float y, float result[2]) { UI_view2d_region_to_view(v2d, x, y, &result[0], &result[1]); } @@ -406,9 +406,9 @@ static void rna_def_view2d_api(StructRNA *srna) func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view"); RNA_def_function_ui_description(func, "Transform region coordinates to 2D view"); - parm = RNA_def_int(func, "x", 0, INT_MIN, INT_MAX, "x", "Region x coordinate", -10000, 10000); + parm = RNA_def_float(func, "x", 0, -FLT_MAX, FLT_MAX, "x", "Region x coordinate", -10000, 10000); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - parm = RNA_def_int(func, "y", 0, INT_MIN, INT_MAX, "y", "Region y coordinate", -10000, 10000); + parm = RNA_def_float(func, "y", 0, -FLT_MAX, FLT_MAX, "y", "Region y coordinate", -10000, 10000); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_float_array(func, "result", -- cgit v1.2.3