Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
24fca621
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
24fca621
编写于
2月 02, 2021
作者:
F
Ferhat
提交者:
GitHub
2月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[web] Fix RRect scaleRadii for negative width/height (#24140)
上级
7bd39b50
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
5 deletion
+21
-5
lib/web_ui/dev/goldens_lock.yaml
lib/web_ui/dev/goldens_lock.yaml
+1
-1
lib/web_ui/lib/src/ui/geometry.dart
lib/web_ui/lib/src/ui/geometry.dart
+6
-4
lib/web_ui/test/golden_tests/engine/canvas_rrect_golden_test.dart
...ui/test/golden_tests/engine/canvas_rrect_golden_test.dart
+14
-0
未找到文件。
lib/web_ui/dev/goldens_lock.yaml
浏览文件 @
24fca621
repository
:
https://github.com/flutter/goldens.git
revision
:
99caeb1bcb8b7a856a78bd8d55816cc97db56112
revision
:
6839c709f859a1abe50e6322dfee17a3a3817c5c
lib/web_ui/lib/src/ui/geometry.dart
浏览文件 @
24fca621
...
...
@@ -701,10 +701,12 @@ class RRect {
RRect
scaleRadii
()
{
double
scale
=
1.0
;
scale
=
_getMin
(
scale
,
blRadiusY
,
tlRadiusY
,
height
);
scale
=
_getMin
(
scale
,
tlRadiusX
,
trRadiusX
,
width
);
scale
=
_getMin
(
scale
,
trRadiusY
,
brRadiusY
,
height
);
scale
=
_getMin
(
scale
,
brRadiusX
,
blRadiusX
,
width
);
final
double
absWidth
=
width
.
abs
();
final
double
absHeight
=
height
.
abs
();
scale
=
_getMin
(
scale
,
blRadiusY
,
tlRadiusY
,
absHeight
);
scale
=
_getMin
(
scale
,
tlRadiusX
,
trRadiusX
,
absWidth
);
scale
=
_getMin
(
scale
,
trRadiusY
,
brRadiusY
,
absHeight
);
scale
=
_getMin
(
scale
,
brRadiusX
,
blRadiusX
,
absWidth
);
if
(
scale
<
1.0
)
{
return
RRect
.
_raw
(
...
...
lib/web_ui/test/golden_tests/engine/canvas_rrect_golden_test.dart
浏览文件 @
24fca621
...
...
@@ -52,6 +52,20 @@ void testMain() async {
await
matchGoldenFile
(
'canvas_rrect_round_square.png'
,
region:
region
);
});
/// Regression test for https://github.com/flutter/flutter/issues/62631
test
(
'round square with flipped left/right coordinates'
,
()
async
{
canvas
.
translate
(
35
,
320
);
canvas
.
drawRRect
(
RRect
.
fromRectAndRadius
(
Rect
.
fromLTRB
(-
30
,
-
100
,
30
,
-
300
),
Radius
.
circular
(
30
)),
niceRRectPaint
);
canvas
.
drawPath
(
Path
()..
moveTo
(
0
,
0
)..
lineTo
(
20
,
0
),
niceRRectPaint
);
html
.
document
.
body
.
append
(
canvas
.
rootElement
);
await
matchGoldenFile
(
'canvas_rrect_flipped.png'
,
region:
Rect
.
fromLTWH
(
0
,
0
,
100
,
200
));
});
test
(
'round rect with big radius scale down smaller radius'
,
()
async
{
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
final
Radius
growingRadius
=
Radius
.
circular
(
rRectRadii
[
i
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录