fix: fix TopLeft corner text render bug

This commit is contained in:
kradchen
2025-10-24 13:37:18 +08:00
parent b1ce05bd29
commit 419e4a0e78

View File

@@ -1237,6 +1237,7 @@ public:
void DICOMImageViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) { void DICOMImageViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) {
sprintf(SERIES_UID, "%s", pSeries->GetUniqueID().c_str()); sprintf(SERIES_UID, "%s", pSeries->GetUniqueID().c_str());
m_cornerInfo.ConstAnno[TOP_LEFT].clear();
// mono and has preset // mono and has preset
if (pSeries->GetNumberOfWindowLevelPresets() > 0 && pSeries->GetSamplePerPixel() == 1) { if (pSeries->GetNumberOfWindowLevelPresets() > 0 && pSeries->GetSamplePerPixel() == 1) {
double *wwwl = pSeries->GetNthWindowLevelPreset(0); double *wwwl = pSeries->GetNthWindowLevelPreset(0);
@@ -1249,12 +1250,10 @@ void DICOMImageViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) {
m_cornerInfo.win_width = 256; m_cornerInfo.win_width = 256;
} }
char buffer[sizeof(long) * 8 + 1];
const char *s = ltoa(pSeries->GetFileNames().size(), buffer, 10);
m_cornerInfo.ConstAnno[TOP_LEFT].clear();
m_cornerInfo.ConstAnno[TOP_LEFT].append(buffer);
m_cornerInfo.ConstAnno[TOP_LEFT].append(" ");
m_cornerInfo.ConstAnno[TOP_LEFT].append(pSeries->GetSeriesNumber()); m_cornerInfo.ConstAnno[TOP_LEFT].append(pSeries->GetSeriesNumber());
m_cornerInfo.ConstAnno[TOP_LEFT].append("\n");
m_cornerInfo.ConstAnno[TOP_LEFT].append(pSeries->GetLaterality());
m_cornerInfo.ConstAnno[TOP_RIGHT].clear(); m_cornerInfo.ConstAnno[TOP_RIGHT].clear();
m_cornerInfo.ConstAnno[TOP_RIGHT].append(pSeries->GetPatientName()); m_cornerInfo.ConstAnno[TOP_RIGHT].append(pSeries->GetPatientName());