[sword-svn] r170 - trunk/src/SwordReader_GUI
dtrotzjr at www.crosswire.org
dtrotzjr at www.crosswire.org
Fri Sep 5 16:29:59 MST 2008
Author: dtrotzjr
Date: 2008-09-05 16:29:58 -0700 (Fri, 05 Sep 2008)
New Revision: 170
Modified:
trunk/src/SwordReader_GUI/SRModuleView.cpp
trunk/src/SwordReader_GUI/SRTextView.cpp
Log:
Fixed 0000033 a minor bug where verses stating with a super-text footnote do not get redrawn correctly in certain circumstances. See mantis report.
Modified: trunk/src/SwordReader_GUI/SRModuleView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRModuleView.cpp 2008-09-05 21:22:06 UTC (rev 169)
+++ trunk/src/SwordReader_GUI/SRModuleView.cpp 2008-09-05 23:29:58 UTC (rev 170)
@@ -107,6 +107,9 @@
{
if(nVerse < 0)
return; // This isn't a valid verse.
+ if(nVerse == 0)
+ nVerse++; // This chapter starts with a heading or some other pretext, so we normalize the verse number here.
+
m_verse.Verse(nVerse);
if(fScroll)
ScrollToVerse(m_verse.Verse());
Modified: trunk/src/SwordReader_GUI/SRTextView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRTextView.cpp 2008-09-05 21:22:06 UTC (rev 169)
+++ trunk/src/SwordReader_GUI/SRTextView.cpp 2008-09-05 23:29:58 UTC (rev 170)
@@ -561,12 +561,14 @@
DrawText(hdc, (TCHAR*)((DWORD)thisWord.m_lpszWord + (thisWord.m_fOwner ? 0 : (DWORD)&m_lpszBuff[0])), thisWord.m_dwWordLen, &thisWord.m_rect,
DT_CALCRECT | DT_LEFT | DT_BOTTOM | DT_SINGLELINE);
- if(m_rsState.m_wSuperState)
+ if(m_rsState.m_wSuperState){
thisWord.m_rect.top -= 1; // TODO: Determine the '1' value based upon the font size
- else if(m_rsState.m_wSubState)
+ thisWord.m_rect.bottom = thisWord.m_rect.top + nLineH + 1;
+ }else if(m_rsState.m_wSubState){
thisWord.m_rect.top = 2*thisWord.m_rect.top + nLineH - thisWord.m_rect.bottom + 1; // TODO: Same as above...
- else
+ }else{
thisWord.m_rect.top = 2*thisWord.m_rect.top + nLineH - thisWord.m_rect.bottom; // Baseline justify
+ }
if(thisWord.m_rect.right > (nScreenWidth - BTEXT_MARGIN)){
// Place on next line. But...
@@ -735,7 +737,7 @@
SetFont(hdc, pTWord->m_dwlfFontState);
}
- ExtTextOut(hdc,pTWord->m_rect.left, pTWord->m_rect.top + m_nTop, NULL, NULL, (TCHAR*)((DWORD)pTWord->m_lpszWord + (pTWord->m_fOwner ? 0 : (DWORD)&m_lpszBuff[0])), pTWord->m_dwWordLen, NULL);
+ ExtTextOut(hdc,pTWord->m_rect.left, pTWord->m_rect.top + m_nTop, NULL, &ps.rcPaint, (TCHAR*)((DWORD)pTWord->m_lpszWord + (pTWord->m_fOwner ? 0 : (DWORD)&m_lpszBuff[0])), pTWord->m_dwWordLen, NULL);
pTWord = pTWord->m_lpNextWord;
}
}
@@ -1261,11 +1263,6 @@
INT SRTextView::SRTextLines::GetVerseAt(INT yPos)
{
- // The following fixes problem when chapter starts w/ a heading but does
- // not yet have a verse number assigned.
- if(yPos == 0)
- return 1;
-
for(DWORD i = 0; i < m_dwLastLine; i++){
if(!m_lppLinesLastWord[i]->m_lpPrevWord)
continue; // We hit a blank line (not neccesarrily the end).
More information about the sword-cvs
mailing list