• R/O
  • HTTP
  • SSH
  • HTTPS

FooEditEngine: Commit


Commit MetaInfo

Revisione50e2271c22764ae861e2deda0af268860cecfcd (tree)
Time2021-01-08 00:22:21
Authortest <test@yaho...>
Commitertest

Log Message

読み込みやスクロールの無駄な動作を省いた

Change Summary

Incremental Difference

--- a/Core/Util.cs
+++ b/Core/Util.cs
@@ -21,10 +21,13 @@ namespace FooEditEngine
2121 class Util
2222 {
2323 #if METRO || WINDOWS_UWP
24+ static float? _LogicalDpi;
2425 public static void GetDpi(out float dpix, out float dpiy)
2526 {
26- dpix = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
27- dpiy = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
27+ if(_LogicalDpi == null)
28+ _LogicalDpi = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
29+ dpix = _LogicalDpi.Value;
30+ dpiy = _LogicalDpi.Value;
2831 }
2932
3033 public static double GetScale()
--- a/UWP/FooEditEngine.UWP/FooTextBox.cs
+++ b/UWP/FooEditEngine.UWP/FooTextBox.cs
@@ -849,7 +849,7 @@ namespace FooEditEngine.UWP
849849 int i_startIndex = args.Request.Range.StartCaretPosition;
850850 int i_endIndex = args.Request.Range.EndCaretPosition;
851851
852- if(args.Request.IsCanceled)
852+ if(args.Request.IsCanceled || i_startIndex == i_endIndex)
853853 {
854854 return;
855855 }
--- a/UWP/Test/MainViewModel.cs
+++ b/UWP/Test/MainViewModel.cs
@@ -89,7 +89,8 @@ namespace Test
8989 using (var ws = await file.OpenAsync(FileAccessMode.Read))
9090 using (var fs = new StreamReader(ws.AsStream()))
9191 {
92- await doc.LoadAsync(fs, null);
92+ var prop = await file.GetBasicPropertiesAsync();
93+ await doc.LoadAsync(fs, null,(int)prop.Size);
9394 }
9495 doc.RequestRedraw();
9596 _list.Add(doc);
Show on old repository browser