浏览代码

fix an error about image cache

/zgh-devtools
guanghuispark 4 年前
当前提交
e8f9898e
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  2. 4
      com.unity.uiwidgets/Runtime/painting/image_cache.cs
  3. 4
      com.unity.uiwidgets/Runtime/painting/image_provider.cs

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


decoration: new BoxDecoration(
image: new DecorationImage(
image: new FileImage(
file:""
file:"test.png"
)
),
shape: BoxShape.circle

decoration: new BoxDecoration(
image: new DecorationImage(
image: new FileImage(
"people/square/sandra"
"test.png"
)
),
shape: BoxShape.circle

4
com.unity.uiwidgets/Runtime/painting/image_cache.cs


}
if (_cache.TryGetValue(key, out var image)) {
_lruKeys.Remove(image.node);
if (image.node != null) {
_lruKeys.Remove(image.node);
}
_trackLiveImage(key, new _LiveImage(image.completer, image.sizeBytes, () => _liveImages.Remove(key)));
image.node = _lruKeys.AddLast(key);
return image.completer;

4
com.unity.uiwidgets/Runtime/painting/image_provider.cs


}
Future<Codec> _loadAsync(FileImage key, DecoderCallback decode) {
byte[] bytes = File.ReadAllBytes(Path.Combine(Application.streamingAssetsPath, key.file));
if (bytes != null && bytes.Length > 0) {
byte[] bytes = File.ReadAllBytes(Path.Combine(Application.dataPath, key.file));
if (bytes.Length > 0) {
return decode(bytes);
}

正在加载...
取消
保存