From 0e9b664fce0ab0c3d5bbf9042c76ffdff8c60fbc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Nov 2010 14:14:06 +0000 Subject: Changes to the ortho grid drawing based on discussion with Ton. - ortho grid now draws scaled by the view3d 'Scale' setting, venomgfx noticed this was missing. - so as not to confuse add scale next to unit display text, so rather then "Metres" it shows "Metres x 1.5" otherwise its confusing that grid lines are not in exact units. - changed grid spacing to grid scale (needed for more logical behavior with units) - when units are enabled grey out subdivisions. --- source/blender/blenkernel/intern/unit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender/blenkernel/intern/unit.c') diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 4cb59a2ee86..54ecef75108 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -69,13 +69,13 @@ /* define a single unit */ typedef struct bUnitDef { - char *name; - char *name_plural; /* abused a bit for the display name */ - char *name_short; /* this is used for display*/ - char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */ + const char *name; + const char *name_plural; /* abused a bit for the display name */ + const char *name_short; /* this is used for display*/ + const char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */ /* if name_short has non-ASCII chars, name_alt should be present */ - char *name_display; /* can be NULL */ + const char *name_display; /* can be NULL */ double scalar; double bias; /* not used yet, needed for converting temperature */ @@ -421,7 +421,7 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system, } -static char *unit_find_str(char *str, char *substr) +static char *unit_find_str(char *str, const char *substr) { char *str_found; @@ -476,7 +476,7 @@ static int ch_is_op(char op) } } -static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, char *replace_str) +static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str) { char *str_found; @@ -755,11 +755,11 @@ void bUnit_GetSystem(void **usys_pt, int *len, int system, int type) *len= usys->length; } -char *bUnit_GetName(void *usys_pt, int index) +const char *bUnit_GetName(void *usys_pt, int index) { return ((bUnitCollection *)usys_pt)->units[index].name; } -char *bUnit_GetNameDisplay(void *usys_pt, int index) +const char *bUnit_GetNameDisplay(void *usys_pt, int index) { return ((bUnitCollection *)usys_pt)->units[index].name_display; } -- cgit v1.2.3