use radians for BLF_rotation
authorCampbell Barton <ideasman42@gmail.com>
Thu, 21 Feb 2013 17:15:19 +0000 (17:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 21 Feb 2013 17:15:19 +0000 (17:15 +0000)
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_internal_types.h
source/blender/editors/interface/view2d.c

index 16756769675c2bac215b785fb395e370c29f0fcd..c622f8c35a2129a46a30b0d4239142e440b484c7 100644 (file)
@@ -516,8 +516,8 @@ static void blf_draw__start(FontBLF *font, GLint *mode, GLint *param)
        if (font->flags & BLF_ASPECT)
                glScalef(font->aspect[0], font->aspect[1], font->aspect[2]);
 
-       if (font->flags & BLF_ROTATION)
-               glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
+       if (font->flags & BLF_ROTATION)  /* radians -> degrees */
+               glRotatef(font->angle * (float)(180.0 / M_PI), 0.0f, 0.0f, 1.0f);
 
        if (font->shadow || font->blur)
                glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
index 1acc3dad4cf8c54db7f8a82633758f2309b33680..de6e70e446192dc7017ed54323692aae349a8386 100644 (file)
@@ -166,7 +166,7 @@ typedef struct FontBLF {
        /* initial position for draw the text. */
        float pos[3];
 
-       /* angle in degrees. */
+       /* angle in radians. */
        float angle;
        
        /* blur: 3 or 5 large kernel */
index ae89b25d5eaf33bd1a84ea3677a195a3c6e586ba..4afcec73a8f8e76363c278935711d1d8365a98c1 100644 (file)
@@ -1805,7 +1805,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
                        /* draw vertical steps */
                        if (dfac > 0.0f) {
                                
-                               BLF_rotation_default(90.0f);
+                               BLF_rotation_default(M_PI / 2);
                                BLF_enable_default(BLF_ROTATION);
 
                                for (; fac < vert.ymax - 10; fac += dfac, val += grid->dy) {