@@ -262,35 +262,6 @@ static QColor get_qcolor(mlt_properties filter_properties,
262262 return QColor (color.r , color.g , color.b , color.a );
263263}
264264
265- static QPen get_qpen (mlt_properties filter_properties,
266- mlt_properties frame_properties,
267- int position,
268- int length)
269- {
270- QColor color;
271- int outline = mlt_properties_get_int (filter_properties, " outline" );
272- QPen pen;
273-
274- pen.setWidth (outline);
275- if (outline) {
276- color = get_qcolor (filter_properties, " olcolour" , frame_properties, position, length);
277- } else {
278- color = get_qcolor (filter_properties, " bgcolour" , frame_properties, position, length);
279- }
280- pen.setColor (color);
281-
282- return pen;
283- }
284-
285- static QBrush get_qbrush (mlt_properties filter_properties,
286- mlt_properties frame_properties,
287- int position,
288- int length)
289- {
290- QColor color = get_qcolor (filter_properties, " fgcolour" , frame_properties, position, length);
291- return QBrush (color);
292- }
293-
294265static void transform_painter (QPainter *painter,
295266 mlt_rect frame_rect,
296267 QRectF path_rect,
@@ -367,10 +338,26 @@ static void paint_text(QPainter *painter,
367338 int position,
368339 int length)
369340{
370- QPen pen = get_qpen (filter_properties, frame_properties, position, length);
371- painter->setPen (pen);
372- QBrush brush = get_qbrush (filter_properties, frame_properties, position, length);
341+ // Draw the outline first, and then draw the fill on top of it.
342+ // This avoids the outline encroaching on the text fill.
343+
344+ // Draw the outline if requested
345+ int outline = mlt_properties_get_int (filter_properties, " outline" );
346+ if (outline) {
347+ QPen pen;
348+ pen.setWidth (outline);
349+ QColor color = get_qcolor (filter_properties, " olcolour" , frame_properties, position, length);
350+ pen.setColor (color);
351+ painter->setPen (pen);
352+ painter->setBrush (Qt::NoBrush); // No brush needed for outline
353+ painter->drawPath (*qpath);
354+ }
355+
356+ // Fill the text area
357+ QColor color = get_qcolor (filter_properties, " fgcolour" , frame_properties, position, length);
358+ QBrush brush (color);
373359 painter->setBrush (brush);
360+ painter->setPen (Qt::NoPen); // No pen needed for fill
374361 painter->drawPath (*qpath);
375362}
376363
0 commit comments