Merge pull request #412 from alcomposer/fix_timecodeeffect_descent

Simple fix for timecode text dropping too low within background
This commit is contained in:
itsmattkc
2019-02-03 15:30:11 +11:00
committed by GitHub
+3 -2
View File
@@ -11,6 +11,7 @@
#include <QComboBox>
#include <QWidget>
#include <QtMath>
#include <QDebug>
#include "ui/labelslider.h"
#include "ui/collapsiblewidget.h"
@@ -93,13 +94,13 @@ void TimecodeEffect::redraw(double timecode) {
text_x = offset_x + (width/2) - (text_width/2);
text_y = offset_y + height - height/10;
rect_y = text_y + fm.descent()/2 - text_height;
rect_y = text_y + fm.descent() - text_height;
path.addText(text_x, text_y, font, display_timecode);
p.setPen(Qt::NoPen);
p.setBrush(background_color);
p.drawRect(QRect(text_x-fm.descent()/2, rect_y, text_width+fm.descent(), text_height));
p.drawRect(QRect(text_x-fm.descent(), rect_y, text_width+fm.descent()*2, text_height));
p.setBrush(color_val->get_color_value(timecode));
p.drawPath(path);
}