Skip to content

Commit 0380b0c

Browse files
committed
Revert "依然无法计算到正确的值"
This reverts commit fe2ae56.
1 parent fe2ae56 commit 0380b0c

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

  • Workbench/Wmf/KawkaywecaljalKayjaybelfuber

Workbench/Wmf/KawkaywecaljalKayjaybelfuber/Program.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
9191
return Encoding.GetEncoding(codePageId);
9292
}
9393

94-
float lastTextOffset = 0;
95-
9694
for (var i = 0; i < wmfDocument.Records.Count; i++)
9795
{
9896
var wmfDocumentRecord = wmfDocument.Records[i];
@@ -129,7 +127,6 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
129127
{
130128
currentX = moveToRecord.X;
131129
currentY = moveToRecord.Y;
132-
lastTextOffset = 0;
133130
break;
134131
}
135132
// - [12] {== WmfLineToRecord ==
@@ -241,15 +238,13 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
241238
skFont.Typeface = SKTypeface.FromFamilyName(currentFontName);
242239
paint.Style = SKPaintStyle.Fill;
243240

244-
lastTextOffset = lastTextOffset % width;
245-
246-
var currentXOffset = currentX + tx + lastTextOffset;
247241
if (dxLength == 0)
248242
{
249-
canvas.DrawText(text, currentXOffset, currentY + ty, skFont, paint);
243+
canvas.DrawText(text, currentX + tx, currentY + ty, skFont, paint);
250244
}
251245
else
252246
{
247+
var currentXOffset = currentX + tx;
253248
UInt16[] dxArray = new UInt16[dxLength / sizeof(UInt16)];
254249
for (var t = 0; t < dxArray.Length; t++)
255250
{
@@ -267,8 +262,6 @@ Encoding CharacterSetToEncoding(CharacterSet characterSet)
267262

268263
currentXOffset += dxArray[textIndex];
269264
}
270-
271-
lastTextOffset = currentXOffset;
272265
}
273266

274267
break;

0 commit comments

Comments
 (0)