Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c03eef4d
Unverified
Commit
c03eef4d
authored
Sep 15, 2022
by
Greg Spencer
Committed by
GitHub
Sep 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no-longer-needed clamping of RRect radii (#111668)
parent
d2636550
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
47 deletions
+3
-47
box_border.dart
packages/flutter/lib/src/painting/box_border.dart
+1
-12
rounded_rectangle_border.dart
...es/flutter/lib/src/painting/rounded_rectangle_border.dart
+1
-12
table_border.dart
packages/flutter/lib/src/rendering/table_border.dart
+1
-12
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+0
-11
No files found.
packages/flutter/lib/src/painting/box_border.dart
View file @
c03eef4d
...
...
@@ -232,18 +232,7 @@ abstract class BoxBorder extends ShapeBorder {
canvas
.
drawRRect
(
borderRadius
.
toRRect
(
rect
),
paint
);
}
else
{
final
RRect
borderRect
=
borderRadius
.
toRRect
(
rect
);
RRect
inner
=
borderRect
.
deflate
(
side
.
strokeInset
);
// Clamp the inner border's radii to zero, until deflate does this
// automatically, so that we can start asserting non-negative values
// in the engine without breaking the framework.
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
inner
=
RRect
.
fromLTRBAndCorners
(
inner
.
left
,
inner
.
top
,
inner
.
right
,
inner
.
bottom
,
topLeft:
inner
.
tlRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
topRight:
inner
.
trRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomLeft:
inner
.
blRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomRight:
inner
.
brRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
);
final
RRect
inner
=
borderRect
.
deflate
(
side
.
strokeInset
);
final
RRect
outer
=
borderRect
.
inflate
(
side
.
strokeOutset
);
canvas
.
drawDRRect
(
outer
,
inner
,
paint
);
}
...
...
packages/flutter/lib/src/painting/rounded_rectangle_border.dart
View file @
c03eef4d
...
...
@@ -132,18 +132,7 @@ class RoundedRectangleBorder extends OutlinedBorder {
final
Paint
paint
=
Paint
()
..
color
=
side
.
color
;
final
RRect
borderRect
=
borderRadius
.
resolve
(
textDirection
).
toRRect
(
rect
);
RRect
inner
=
borderRect
.
deflate
(
side
.
strokeInset
);
// Clamp the inner border's radii to zero, until deflate does this
// automatically, so that we can start asserting non-negative values
// in the engine without breaking the framework.
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
inner
=
RRect
.
fromLTRBAndCorners
(
inner
.
left
,
inner
.
top
,
inner
.
right
,
inner
.
bottom
,
topLeft:
inner
.
tlRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
topRight:
inner
.
trRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomLeft:
inner
.
blRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomRight:
inner
.
brRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
);
final
RRect
inner
=
borderRect
.
deflate
(
side
.
strokeInset
);
final
RRect
outer
=
borderRect
.
inflate
(
side
.
strokeOutset
);
canvas
.
drawDRRect
(
outer
,
inner
,
paint
);
}
...
...
packages/flutter/lib/src/rendering/table_border.dart
View file @
c03eef4d
...
...
@@ -271,18 +271,7 @@ class TableBorder {
paintBorder
(
canvas
,
rect
,
top:
top
,
right:
right
,
bottom:
bottom
,
left:
left
);
}
else
{
final
RRect
outer
=
borderRadius
.
toRRect
(
rect
);
RRect
inner
=
outer
.
deflate
(
top
.
width
);
// Clamp the inner border's radii to zero, until deflate does this
// automatically, so that we can start asserting non-negative values
// in the engine without breaking the framework.
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
inner
=
RRect
.
fromLTRBAndCorners
(
inner
.
left
,
inner
.
top
,
inner
.
right
,
inner
.
bottom
,
topLeft:
inner
.
tlRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
topRight:
inner
.
trRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomLeft:
inner
.
blRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomRight:
inner
.
brRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
);
final
RRect
inner
=
outer
.
deflate
(
top
.
width
);
final
Paint
paint
=
Paint
()..
color
=
top
.
color
;
canvas
.
drawDRRect
(
outer
,
inner
,
paint
);
}
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
c03eef4d
...
...
@@ -129,17 +129,6 @@ class _MulticastCanvas implements Canvas {
@override
void
drawDRRect
(
RRect
outer
,
RRect
inner
,
Paint
paint
)
{
// Clamp the inner border's radii to zero, until deflate does this
// automatically, so that we can start asserting non-negative values
// in the engine without breaking the framework.
// TODO(gspencergoog): Remove this once https://github.com/flutter/engine/pull/36062 rolls into the framework.
inner
=
RRect
.
fromLTRBAndCorners
(
inner
.
left
,
inner
.
top
,
inner
.
right
,
inner
.
bottom
,
topLeft:
inner
.
tlRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
topRight:
inner
.
trRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomLeft:
inner
.
blRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
bottomRight:
inner
.
brRadius
.
clamp
(
minimum:
Radius
.
zero
),
// ignore_clamp_double_lint
);
_main
.
drawDRRect
(
outer
,
inner
,
paint
);
_screenshot
.
drawDRRect
(
outer
,
inner
,
paint
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment