diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-26 01:21:38 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-26 01:21:38 +0400 |
commit | f2a1a795cf324840d047a0db83497e348797c890 (patch) | |
tree | 44b284fb0cec1d7bbb48e3b7f7c4963aba8c043d /source | |
parent | cb19149762239b75ca2610655448c63360651d2e (diff) |
Fix [#33997] Units Scale in Metric mode displays wrong face area.
Also now display nice "area" units (maybe using "length" units was a perf matter, but anyway, you can't have more than a few tens of values displayed at a time, after that they become unreadable). Easy to undo anyway if we really want to keep ugly "10m" as area display!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 25 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_translations.c | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 4eb42f7cefd..6dd3ecca244 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2653,16 +2653,21 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS BMFace *f; int n; -#define DRAW_EM_MEASURE_STATS_FACEAREA() \ - if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { \ - mul_v3_fl(vmid, 1.0f / (float)n); \ - if (unit->system) \ - bUnit_AsString(numstr, sizeof(numstr), \ - (double)(area * unit->scale_length), \ - 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); \ - else \ - BLI_snprintf(numstr, sizeof(numstr), conv_float, area); \ - view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col); \ +#define DRAW_EM_MEASURE_STATS_FACEAREA() \ + if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { \ + mul_v3_fl(vmid, 1.0f / (float)n); \ + if (unit->system) { \ + bUnit_AsString(numstr, sizeof(numstr), \ + (double)(area * unit->scale_length * unit->scale_length), \ + 3, unit->system, B_UNIT_AREA, do_split, FALSE); \ + view3d_cached_text_draw_add(vmid, numstr, 0, \ + /* Metric system uses unicode "squared" sign! */ \ + txt_flag ^ V3D_CACHE_TEXT_ASCII, col); \ + } \ + else { \ + BLI_snprintf(numstr, sizeof(numstr), conv_float, area); \ + view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col); \ + } \ } (void)0 UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col); diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index db99d6bcf92..b6d2f624229 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -708,7 +708,7 @@ static PyTypeObject BlenderAppTranslationsType = { /* newfunc tp_new; */ (newfunc)app_translations_new, /* Low-level free-memory routine */ - app_translations_free, /* freefunc tp_free; */ + app_translations_free, /* freefunc tp_free; */ /* For PyObject_IS_GC */ NULL, /* inquiry tp_is_gc; */ NULL, /* PyObject *tp_bases; */ |