OSDN Git Service

読み込み時に行分割を行わず、レタリング時に行分割を行うようにした
[fooeditengine/FooEditEngine.git] / WPF / FooEditEngine / WPF / WPFRender.cs
index 330e162..f0deeaf 100644 (file)
@@ -489,10 +489,12 @@ namespace FooEditEngine.WPF
 
         public void BeginClipRect(Rectangle rect)
         {
+            this.Context.PushClip(new RectangleGeometry(rect));
         }
 
         public void EndClipRect()
         {
+            this.Context.Pop();
         }
 
         public List<LineToIndexTableData> BreakLine(Document doc, LineToIndexTable layoutLineCollection, int startIndex, int endIndex, double wrapwidth)
@@ -534,10 +536,19 @@ namespace FooEditEngine.WPF
             return output;
         }
 
-        public ITextLayout CreateLaytout(string str, SyntaxInfo[] syntaxCollection, IEnumerable<Marker> MarkerRanges, IEnumerable<Selection> SelectRanges)
+        public ITextLayout CreateLaytout(string str, SyntaxInfo[] syntaxCollection, IEnumerable<Marker> MarkerRanges, IEnumerable<Selection> SelectRanges, double wrapwidth)
         {
-            TextLayout layout = new TextLayout(str,this.FontFamily,this.FontSize,Brushes[this.Foreground],this.TextArea.Width);
-            layout.TextWarpping = TextWrapping.NoWrap;
+            TextLayout layout;
+            if(wrapwidth == LineToIndexTable.NONE_BREAK_LINE)
+            {
+                layout = new TextLayout(str, this.FontFamily, this.FontSize, Brushes[this.Foreground], this.TextArea.Width);
+                layout.TextWarpping = TextWrapping.NoWrap;
+            }
+            else
+            {
+                layout = new TextLayout(str, this.FontFamily, this.FontSize, Brushes[this.Foreground], wrapwidth);
+                layout.TextWarpping = TextWrapping.Wrap;
+            }
             layout.FlowDirection = this.RightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
 
             if (syntaxCollection != null)