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!
This commit is contained in:
Bastien Montagne
2013-01-25 21:21:38 +00:00
parent cb19149762
commit f2a1a795cf
2 changed files with 16 additions and 11 deletions
@@ -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);
@@ -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; */