Skip to content

Commit

Permalink
[subtitle] fix background for external subitles step 2
Browse files Browse the repository at this point in the history
  • Loading branch information
koivo committed Apr 30, 2024
1 parent 9b73582 commit f7eb2ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/dvb/subtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ int eDVBSubtitleParser::subtitle_process_pixel_data(subtitle_region *region, sub
default:
return -1;
}
return 0;
}

int eDVBSubtitleParser::subtitle_process_segment(uint8_t *segment)
Expand Down Expand Up @@ -757,11 +756,13 @@ int eDVBSubtitleParser::subtitle_process_segment(uint8_t *segment)
{
subtitle_redraw_all();
m_seen_eod = true;
break;
}
case 0xFF: // stuffing
break;
default:
eDebug("[eDVBSubtitleParser] unhandled segment type %02x", segment_type);
break;
}

return segment_length + 6;
Expand Down
4 changes: 2 additions & 2 deletions lib/gui/esubtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ int eSubtitleWidget::event(int event, void *data, void *data2)
painter.setFont(subtitleStyles[face].font);

eRect &area = element.m_area;
if (eConfigManager::getConfigBoolValue("config.subtitles.showbackground"))
if (bcktrans != 255)
{
ePtr<eTextPara> para = new eTextPara(area);
para->setFont(subtitleStyles[face].font);
Expand All @@ -487,7 +487,7 @@ int eSubtitleWidget::event(int event, void *data, void *data2)
bbox.setTop(bboxTop);
bbox.setHeight(bboxHeight);
area.setTop(area.top() - borderwidth);
painter.setForegroundColor(gRGB(0,0,0,64));
painter.setForegroundColor(gRGB(0,0,0,bcktrans));
painter.fill(bbox);
borderwidth = 0;
}
Expand Down

0 comments on commit f7eb2ad

Please sign in to comment.