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
ec6ed72e
Commit
ec6ed72e
authored
Feb 17, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated per review feedback
parent
c832aff1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
grid.dart
packages/flutter/lib/src/rendering/grid.dart
+12
-6
No files found.
packages/flutter/lib/src/rendering/grid.dart
View file @
ec6ed72e
...
...
@@ -50,6 +50,10 @@ class GridSpecification {
}
/// Creates a grid specification containing a certain number of equally sized tiles.
/// The tileWidth is the sum of the width of the child it will contain and
/// columnSpacing (even if columnCount is 1). Similarly tileHeight is child's height
/// plus rowSpacing. If the tiles are to completely fill the grid, then their size
/// should be based on the grid's padded interior.
GridSpecification
.
fromRegularTiles
({
double
tileWidth
,
double
tileHeight
,
...
...
@@ -62,6 +66,8 @@ class GridSpecification {
rowOffsets
=
_generateRegularOffsets
(
rowCount
,
tileHeight
)
{
assert
(
_debugIsMonotonic
(
columnOffsets
));
assert
(
_debugIsMonotonic
(
rowOffsets
));
assert
(
columnSpacing
!=
null
&&
columnSpacing
>=
0.0
);
assert
(
rowSpacing
!=
null
&&
rowSpacing
>=
0.0
);
assert
(
padding
!=
null
&&
padding
.
isNonNegative
);
}
...
...
@@ -209,8 +215,8 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
bool
shouldRelayout
(
GridDelegateWithInOrderChildPlacement
oldDelegate
)
{
return
columnSpacing
!=
oldDelegate
.
columnSpacing
||
rowSpacing
!=
oldDelegate
.
rowSpacing
||
padding
!=
oldDelegate
.
padding
;
||
rowSpacing
!=
oldDelegate
.
rowSpacing
||
padding
!=
oldDelegate
.
padding
;
}
}
...
...
@@ -468,10 +474,10 @@ class RenderGrid extends RenderVirtualViewport<GridParentData> {
assert
(
placement
.
column
+
placement
.
columnSpan
<
_specification
.
columnOffsets
.
length
);
assert
(
placement
.
row
+
placement
.
rowSpan
<
_specification
.
rowOffsets
.
length
);
double
tileLeft
=
_specification
.
columnOffsets
[
placement
.
column
]
+
gridLeftPadding
;
double
tileRight
=
_specification
.
columnOffsets
[
placement
.
column
+
placement
.
columnSpan
]
+
gridLeftPadding
;
double
tileTop
=
_specification
.
rowOffsets
[
placement
.
row
]
+
gridTopPadding
;
double
tileBottom
=
_specification
.
rowOffsets
[
placement
.
row
+
placement
.
rowSpan
]
+
gridTopPadding
;
double
tileLeft
=
gridLeftPadding
+
_specification
.
columnOffsets
[
placement
.
column
]
;
double
tileRight
=
gridLeftPadding
+
_specification
.
columnOffsets
[
placement
.
column
+
placement
.
columnSpan
]
;
double
tileTop
=
gridTopPadding
+
_specification
.
rowOffsets
[
placement
.
row
]
;
double
tileBottom
=
gridTopPadding
+
_specification
.
rowOffsets
[
placement
.
row
+
placement
.
rowSpan
]
;
double
childWidth
=
math
.
max
(
0.0
,
tileRight
-
tileLeft
-
_specification
.
columnSpacing
);
double
childHeight
=
math
.
max
(
0.0
,
tileBottom
-
tileTop
-
_specification
.
rowSpacing
);
...
...
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