OSDN Git Service

グリフの幅が0の可能性があった
authorgdkhd812 <test@yahoo.co.jp>
Mon, 15 May 2017 13:56:27 +0000 (22:56 +0900)
committergdkhd812 <test@yahoo.co.jp>
Mon, 15 May 2017 13:56:27 +0000 (22:56 +0900)
Core/Direct2D/CustomTextRenderer.cs

index da48246..9df39fb 100644 (file)
@@ -101,8 +101,10 @@ namespace FooEditEngine
             bounds.Left = baselineOriginX;
             if (glyphCount > 0)
                 bounds.Right = right;
-            else
+            else if (myGlyphRun.Advances.Length == 1)
                 bounds.Right = baselineOriginX + myGlyphRun.Advances[0];
+            else
+                bounds.Right = bounds.Left;
             bounds.Top = baselineOriginY - ascentPixel;
             bounds.Bottom = baselineOriginY + dscentPixel;