Skip to content

Commit

Permalink
606: _tmpGlypIndexBackup is just temp
Browse files Browse the repository at this point in the history
for debug  only
  • Loading branch information
prepare committed Nov 16, 2017
1 parent 776257e commit b981263
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Typography.GlyphLayout/GlyphIndexList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public void Replace(int index, ushort newGlyphIndex)
_glyphIndices[index] = newGlyphIndex;
}

#if DEBUG
List<GlyphIndexToUserChar> _tmpGlypIndexBackup = new List<GlyphIndexToUserChar>();
#endif
/// <summary>
/// remove:add_new >=1:1
/// </summary>
Expand All @@ -101,18 +103,19 @@ public void Replace(int index, int removeLen, ushort newGlyphIndex)
//and then replace with a single glyph
_glyphIndices.RemoveRange(index, removeLen);
_glyphIndices.Insert(index, newGlyphIndex);
//------------------------------------------------
//------------------------------------------------

GlyphIndexToUserChar firstRemove = _mapGlyphIndexToUserChar[index];

#if DEBUG
_tmpGlypIndexBackup.Clear();
int endAt = index + removeLen;
for (int i = index; i < endAt; ++i)
{
_tmpGlypIndexBackup.Add(_mapGlyphIndexToUserChar[i]);
}
//------------------------------------------------
GlyphIndexToUserChar firstRemove = _tmpGlypIndexBackup[0];
_tmpGlypIndexBackup.RemoveRange(0, removeLen);
//add new data

_tmpGlypIndexBackup.Clear();
#endif
//TODO: check if removeLen > ushort.Max
GlyphIndexToUserChar newMap = new GlyphIndexToUserChar(firstRemove.o_user_charOffset, (ushort)removeLen);
#if DEBUG
Expand All @@ -121,7 +124,7 @@ public void Replace(int index, int removeLen, ushort newGlyphIndex)

//------------------------------------------------
_mapGlyphIndexToUserChar.Insert(index, newMap);
_tmpGlypIndexBackup.Clear();

}
/// <summary>
/// remove: add_new 1:>=1
Expand Down

0 comments on commit b981263

Please sign in to comment.