Fix T46155: Sequencer Text Effect: wrong vertical 'TOP' alignment.
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 18 Sep 2015 21:01:31 +0000 (23:01 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 18 Sep 2015 21:01:31 +0000 (23:01 +0200)
Logic was broken for this vertical alignment option - we need to remove one line height here...

source/blender/blenkernel/intern/seqeffects.c

index fac88e2aa247fa95a1ca32b7b01c7816b682832e..f375c2b1e4fd5760e4e63b8c432860eee60b0587 100644 (file)
@@ -2960,7 +2960,7 @@ static ImBuf *do_text_effect(const SeqRenderData *context, Sequence *seq, float
        if ((data->align   == SEQ_TEXT_ALIGN_X_LEFT) &&
            (data->align_y == SEQ_TEXT_ALIGN_Y_TOP))
        {
-               /* pass */
+               y -= line_height;
        }
        else {
                /* vars for calculating wordwrap */
@@ -2978,7 +2978,10 @@ static ImBuf *do_text_effect(const SeqRenderData *context, Sequence *seq, float
                        x -= BLI_rctf_size_x(&wrap.rect) / 2;
                }
 
-               if (data->align_y == SEQ_TEXT_ALIGN_Y_BOTTOM) {
+               if (data->align_y == SEQ_TEXT_ALIGN_Y_TOP) {
+                       y -= line_height;
+               }
+               else if (data->align_y == SEQ_TEXT_ALIGN_Y_BOTTOM) {
                        y += (wrap.info.lines - 1) * line_height;
                }
                else if (data->align_y == SEQ_TEXT_ALIGN_Y_CENTER) {