Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lindexi_gd
Uno
提交
11408b3f
U
Uno
项目概览
lindexi_gd
/
Uno
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Uno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
11408b3f
编写于
4月 26, 2023
作者:
M
Martin Zikmund
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: Workaround jumping ScrollViewers on Skia
上级
22c2c0e6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
19 deletion
+36
-19
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs
+4
-4
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs
+18
-14
src/Uno.UI/UI/Xaml/UIElement.cs
src/Uno.UI/UI/Xaml/UIElement.cs
+1
-1
src/Uno.UI/UI/Xaml/UIElement.skia.cs
src/Uno.UI/UI/Xaml/UIElement.skia.cs
+13
-0
未找到文件。
src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml/UIElement.cs
浏览文件 @
11408b3f
...
...
@@ -94,8 +94,8 @@ namespace Windows.UI.Xaml
}
}
#
endif
#
if
__ANDROID__
||
__IOS__
||
NET461
||
__WASM__
||
__SKIA__
||
__NETSTD_REFERENCE__
||
__MACOS__
[
global
::
Uno
.
NotImplemented
(
"__ANDROID__"
,
"__IOS__"
,
"NET461"
,
"__WASM__"
,
"__
SKIA__"
,
"__
NETSTD_REFERENCE__"
,
"__MACOS__"
)]
#
if
__ANDROID__
||
__IOS__
||
NET461
||
__WASM__
||
false
||
__NETSTD_REFERENCE__
||
__MACOS__
[
global
::
Uno
.
NotImplemented
(
"__ANDROID__"
,
"__IOS__"
,
"NET461"
,
"__WASM__"
,
"__NETSTD_REFERENCE__"
,
"__MACOS__"
)]
public
bool
UseLayoutRounding
{
get
...
...
@@ -554,8 +554,8 @@ namespace Windows.UI.Xaml
// Skipping already declared property RightTappedEvent
// Skipping already declared property DragEnterEvent
// Skipping already declared property TappedEvent
#
if
__ANDROID__
||
__IOS__
||
NET461
||
__WASM__
||
__SKIA__
||
__NETSTD_REFERENCE__
||
__MACOS__
[
global
::
Uno
.
NotImplemented
(
"__ANDROID__"
,
"__IOS__"
,
"NET461"
,
"__WASM__"
,
"__
SKIA__"
,
"__
NETSTD_REFERENCE__"
,
"__MACOS__"
)]
#
if
__ANDROID__
||
__IOS__
||
NET461
||
__WASM__
||
false
||
__NETSTD_REFERENCE__
||
__MACOS__
[
global
::
Uno
.
NotImplemented
(
"__ANDROID__"
,
"__IOS__"
,
"NET461"
,
"__WASM__"
,
"__NETSTD_REFERENCE__"
,
"__MACOS__"
)]
public
static
global
::
Windows
.
UI
.
Xaml
.
DependencyProperty
UseLayoutRoundingProperty
{
get
;
}
=
Windows
.
UI
.
Xaml
.
DependencyProperty
.
Register
(
nameof
(
UseLayoutRounding
),
typeof
(
bool
),
...
...
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs
浏览文件 @
11408b3f
...
...
@@ -21,6 +21,7 @@ using Windows.UI.Xaml.Input;
using
Uno
;
using
Uno.Extensions
;
using
Uno.Foundation.Logging
;
using
Uno.UI.Extensions
;
#if __ANDROID__
...
...
@@ -49,6 +50,7 @@ using Microsoft.UI.Input;
#else
using
Windows.Devices.Input
;
using
Windows.UI.Input
;
using
Windows.UI.Xaml.Media
;
#endif
namespace
Windows.UI.Xaml.Controls
...
...
@@ -775,23 +777,16 @@ namespace Windows.UI.Xaml.Controls
ExtentWidth
=
0
;
}
var
scrollableHeight
=
Math
.
Max
(
ExtentHeight
-
ViewportHeight
,
0
);
// On Skia, the ExtentHeight can include a rounding error, which may cause
// unwanted ScrollBar to pop in and out of existence.
if
(
scrollableHeight
<
0.1
)
{
scrollableHeight
=
0
;
}
// For scrollable height and scrollable width we apply rounding
// to ensure there is no unwanted difference caused by double
// precision, which could then cause the scroll bars to appear
// for no reason.
var
scrollableHeight
=
Math
.
Max
(
Math
.
Round
(
ExtentHeight
-
ViewportHeight
,
4
),
0
);
ScrollableHeight
=
scrollableHeight
;
var
scrollableWidth
=
Math
.
Max
(
ExtentWidth
-
ViewportWidth
,
0
);
// On Skia, the ExtentWidth can include a rounding error, which may cause
// unwanted ScrollBar to pop in and out of existence.
if
(
scrollableWidth
<
0.1
)
{
scrollableWidth
=
0
;
}
var
scrollableWidth
=
Math
.
Max
(
Math
.
Round
(
ExtentWidth
-
ViewportWidth
,
4
),
0
);
ScrollableWidth
=
scrollableWidth
;
...
...
@@ -941,6 +936,15 @@ namespace Windows.UI.Xaml.Controls
base
.
OnApplyTemplate
();
#if __SKIA__
// To work around non-uniformly applied layout rounding behavior, we need to force set layout
// rounding on the child Grid currently. #12082
if
(
this
.
FindFirstDescendant
<
Grid
>()
is
{
}
grid
)
{
grid
.
UseLayoutRounding
=
false
;
}
#endif
var
scpTemplatePart
=
GetTemplateChild
(
Parts
.
WinUI3
.
Scroller
)
??
GetTemplateChild
(
Parts
.
Uwp
.
ScrollContentPresenter
);
_presenter
=
scpTemplatePart
as
_ScrollContentPresenter
;
...
...
src/Uno.UI/UI/Xaml/UIElement.cs
浏览文件 @
11408b3f
...
...
@@ -956,7 +956,7 @@ namespace Windows.UI.Xaml
internal
bool
GetUseLayoutRounding
()
{
#if __SKIA__
return
true
;
return
UseLayoutRounding
;
#else
return
false
;
#endif
...
...
src/Uno.UI/UI/Xaml/UIElement.skia.cs
浏览文件 @
11408b3f
...
...
@@ -41,6 +41,19 @@ namespace Windows.UI.Xaml
UpdateHitTest
();
}
public
bool
UseLayoutRounding
{
get
=>
(
bool
)
this
.
GetValue
(
UseLayoutRoundingProperty
);
set
=>
this
.
SetValue
(
UseLayoutRoundingProperty
,
value
);
}
public
static
DependencyProperty
UseLayoutRoundingProperty
{
get
;
}
=
DependencyProperty
.
Register
(
nameof
(
UseLayoutRounding
),
typeof
(
bool
),
typeof
(
UIElement
),
new
FrameworkPropertyMetadata
(
true
));
internal
bool
IsChildrenRenderOrderDirty
{
get
;
set
;
}
=
true
;
partial
void
InitializeKeyboard
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录