From: <sil...@li...> - 2005-02-28 16:07:17
|
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19342/GrEngine Modified Files: GrSegment.cpp Log Message: Patch from Sharon and Keith Stribley for Uniscribe bits Index: GrSegment.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSegment.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- GrSegment.cpp 6 Oct 2004 18:28:31 -0000 1.27 +++ GrSegment.cpp 28 Feb 2005 16:06:55 -0000 1.28 @@ -1957,6 +1957,12 @@ LgLineBreak lbFirst, lbLast; int isloutFirst = UnderlyingToLogicalSurface(ichBase, ich, true); + if (isloutFirst == kPosInfinity || isloutFirst == kNegInfinity) + { + //printf("Invalid start surface position base%d ich%d\n", ichBase, ich); + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutFirst = m_prgslout + isloutFirst; bool fNotFirst = false; if (psloutFirst->HasComponents() @@ -1972,6 +1978,12 @@ } int isloutLast = UnderlyingToLogicalSurface(ichBase, ich, false); + if (isloutLast == kPosInfinity || isloutLast == kNegInfinity) + { + //printf("Invalid end surface position base%d ich%d\n", ichBase, ich); + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutLast = m_prgslout + isloutLast; bool fNotLast = false; if (psloutLast->HasComponents() @@ -5530,23 +5542,28 @@ { int ichStartOrig = min(ich1, ich2); int ichStopOrig = max(ich1, ich2); - - // Find the beginning of the cluster. + int isloutMin = visloutBefore[ichStopOrig]; + int isloutMax = visloutAfter[ichStopOrig]; + int ichStart = ichStopOrig; + int ichStop = ichStartOrig; + + // Find the beginning of the cluster. while (ichStart > 0 && (ichStart > ichStartOrig || visloutBefore[ichStart - 1] >= visloutBefore[ichStopOrig])) { ichStart--; isloutMin = std::min(isloutMin, visloutBefore[ichStart]); + isloutMax = std::max(isloutMax, visloutAfter[ichStart]); } + // Find end of cluster. - int isloutMax = visloutAfter[ichStartOrig]; - int ichStop = ichStartOrig; while (ichStop < m_dichwLim - 1 && (ichStop < ichStopOrig || visloutAfter[ichStop + 1] <= visloutAfter[ichStartOrig])) { ichStop++; + isloutMin = std::min(isloutMin, visloutBefore[ichStart]); isloutMax = std::max(isloutMax, visloutAfter[ichStop]); } |