OSDN Git Service

UWP版テキストボックスを作った
[fooeditengine/FooEditEngine.git] / Core / Direct2D / D2DRenderCommon.cs
index 89e1f28..be7e4ce 100644 (file)
@@ -180,7 +180,7 @@ namespace FooEditEngine
         TextAntialiasMode _TextAntialiasMode;
         Color4 _ControlChar,_Forground,_URL,_Hilight;
         DW.Factory DWFactory;
-#if METRO
+#if METRO || WINDOWS_UWP
         D2D.Factory1 D2DFactory;
 #else
         D2D.Factory D2DFactory;
@@ -208,7 +208,7 @@ namespace FooEditEngine
         public D2DRenderCommon()
         {
             this.DWFactory = new DW.Factory(DW.FactoryType.Shared);
-#if METRO
+#if METRO || WINDOWS_UWP
             this.D2DFactory = new D2D.Factory1(D2D.FactoryType.MultiThreaded);
 #else
             this.D2DFactory = new D2D.Factory(D2D.FactoryType.MultiThreaded);
@@ -717,12 +717,15 @@ namespace FooEditEngine
             this.render.DrawLine(from, to, brush, 1.0f, stroke);
         }
 
+        public const int BoldThickness = 2;
+        public const int NormalThickness = 1;
+
         public void DrawMarkerEffect(MyTextLayout layout, HilightType type, int start, int length, double x, double y, bool isBold, Color4? effectColor = null)
         {
             if (type == HilightType.None)
                 return;
 
-            float thickness = isBold ? 2 : 1;
+            float thickness = isBold ? BoldThickness : NormalThickness;
 
             Color4 color;
             if (effectColor != null)
@@ -892,7 +895,7 @@ namespace FooEditEngine
             this.TextAntialiasMode = this._TextAntialiasMode;
         }
 
-#if METRO
+#if METRO || WINDOWS_UWP
         protected virtual D2D.RenderTarget ConstructRender(D2D.Factory1 factory, D2D.RenderTargetProperties prop, double width, double height)
 #else
         protected virtual D2D.RenderTarget ConstructRender(D2D.Factory factory, D2D.RenderTargetProperties prop, double width, double height)