diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-12 03:42:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-12 03:42:26 +0400 |
commit | 4124e2e0c9d42ec8d84ef06025932abeb333cd65 (patch) | |
tree | f0cbd062c81b888a6b0ce9c16f23227edb22050b /source/blender/editors/transform | |
parent | 0e6e171cddf6740d9c20113303b82695943e0899 (diff) |
get the width and height of the font at once when drawing auto-key,
also move BLF'g global font init into its own static function.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ccb9fe4d076..39b0ab4b3a6 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1561,13 +1561,16 @@ static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), voi } /* just draw a little warning message in the top-right corner of the viewport to warn that autokeying is enabled */ -static void drawAutoKeyWarning(TransInfo *t, ARegion *ar) +static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar) { const char printable[] = "Auto Keying On"; + float printable_size[2]; int xco, yco; + + BLF_width_and_height_default(printable, &printable_size[0], &printable_size[1]); - xco = ar->winx - BLF_width_default(printable) - 10; - yco = ar->winy - BLF_height_default(printable) - 10; + xco = ar->winx - (int)printable_size[0] - 10; + yco = ar->winy - (int)printable_size[1] - 10; /* warning text (to clarify meaning of overlays) * - original color was red to match the icon, but that clashes badly with a less nasty border |