Skip to content

Commit

Permalink
fix consumer scaling for rich text in qtext filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Aug 22, 2020
1 parent 9be412f commit 48f8dcc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/qt/filter_qtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
if( !error )
{
double scale = mlt_profile_scale_width(profile, *width);
double scale_height = mlt_profile_scale_height(profile, *height);
if ( geom_str.contains('%') )
{
rect.x *= *width;
Expand All @@ -313,7 +314,6 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
}
else
{
double scale_height = mlt_profile_scale_height(profile, *height);
rect.x *= scale;
rect.y *= scale_height;
rect.w *= scale;
Expand All @@ -324,12 +324,12 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
convert_mlt_to_qimage_rgba( *image, &qimg, *width, *height );

QPainterPath text_path;
QRectF path_rect(0, 0, rect.w, rect.h);
QRectF path_rect(0, 0, rect.w / scale, rect.h / scale_height);
QPainter painter( &qimg );
painter.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::HighQualityAntialiasing );
if (isRichText) {
mlt_service_lock(MLT_FILTER_SERVICE(filter));
auto doc = get_rich_text(filter_properties, rect.w, rect.h);
auto doc = get_rich_text(filter_properties, path_rect.width(), path_rect.height());
mlt_service_unlock(MLT_FILTER_SERVICE(filter));
if (doc) {
transform_painter(&painter, rect, path_rect, filter_properties, profile);
Expand Down

0 comments on commit 48f8dcc

Please sign in to comment.