OSDN Git Service

行を生成するメソッドをLineToIndexTableに移動した
[fooeditengine/FooEditEngine.git] / Metro / FooEditEngine / Direct2D / D2DRender.cs
index f8003b6..42990bf 100644 (file)
@@ -115,8 +115,7 @@ namespace FooEditEngine
 
         public override void GetDpi(out float dpix, out float dpiy)
         {
-            dpix = DisplayInformation.GetForCurrentView().LogicalDpi;
-            dpiy = DisplayInformation.GetForCurrentView().LogicalDpi;
+            Util.GetDpi(out dpix, out dpiy);
         }
 
         public bool Resize(Windows.UI.Xaml.Shapes.Rectangle rect, double width, double height)
@@ -133,9 +132,9 @@ namespace FooEditEngine
             return this.Size.Height != 0 && this.Size.Width != 0;
         }
 
-        public override void BegineDraw()
+        public void DrawContent(EditView view,bool IsEnabled,Rectangle updateRect)
         {
-            SharpDX.Point offset;
+            SharpDX.Mathematics.Interop.RawPoint offset;
             this.Surface = this.SurfaceImageNative.BeginDraw(
                 new SharpDX.Rectangle(0, 0, (int)this.Size.Width, (int)this.Size.Height), out offset);
             float dpix, dpiy;
@@ -144,12 +143,14 @@ namespace FooEditEngine
                     dpix, dpiy, D2D.BitmapOptions.Target | D2D.BitmapOptions.CannotDraw);
             this.Bitmap = new D2D.Bitmap1(this.D2DContext, this.Surface, prop);
             this.D2DContext.Target = this.Bitmap;
-            this.D2DContext.Transform = Matrix3x2.Translation(offset.X,offset.Y);
+            this.D2DContext.Transform = Matrix3x2.Translation(offset.X, offset.Y);
             base.BegineDraw();
-        }
 
-        public override void EndDraw()
-        {
+            if (IsEnabled)
+                view.Draw(updateRect);
+            else
+                this.FillBackground(updateRect);
+
             base.EndDraw();
             this.Surface.Dispose();
             this.Bitmap.Dispose();