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
4d84e1b7
Commit
4d84e1b7
authored
Sep 04, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow negative padding and margins
They're just as crazy in this system as they are in the web.
parent
4e01c054
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
box_painter.dart
packages/flutter/lib/painting/box_painter.dart
+2
-0
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+1
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+4
-1
No files found.
packages/flutter/lib/painting/box_painter.dart
View file @
4d84e1b7
...
...
@@ -45,6 +45,8 @@ class EdgeDims {
/// The offset from the left
final
double
left
;
bool
get
isNonNegative
=>
top
>=
0.0
&&
right
>=
0.0
&&
bottom
>=
0.0
&&
left
>=
0.0
;
bool
operator
==(
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
4d84e1b7
...
...
@@ -79,6 +79,7 @@ class RenderPadding extends RenderShiftedBox {
EdgeDims
get
padding
=>
_padding
;
void
set
padding
(
EdgeDims
value
)
{
assert
(
value
!=
null
);
assert
(
value
.
isNonNegative
);
if
(
_padding
==
value
)
return
;
_padding
=
value
;
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
4d84e1b7
...
...
@@ -393,7 +393,10 @@ class Container extends Component {
this
.
margin
,
this
.
padding
,
this
.
transform
})
:
super
(
key:
key
);
})
:
super
(
key:
key
)
{
assert
(
margin
==
null
||
margin
.
isNonNegative
);
assert
(
padding
==
null
||
padding
.
isNonNegative
);
}
final
Widget
child
;
final
BoxConstraints
constraints
;
...
...
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