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
bf74bac5
Commit
bf74bac5
authored
Nov 03, 2015
by
Jason Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RRect immutable and replace RRect.setRectXY with a fromRectXY constructor
parent
5ea50bf4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
checkbox.dart
packages/flutter/lib/src/material/checkbox.dart
+2
-2
switch.dart
packages/flutter/lib/src/material/switch.dart
+2
-2
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+3
-3
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+1
-1
No files found.
packages/flutter/lib/src/material/checkbox.dart
View file @
bf74bac5
...
...
@@ -151,8 +151,8 @@ class _RenderCheckbox extends RenderToggleable {
// Create an inner rectangle to cover inside of rectangle. This is needed to avoid
// painting artefacts caused by overlayed paintings.
Rect
innerRect
=
rect
.
deflate
(
1.0
);
ui
.
RRect
rrect
=
new
ui
.
RRect
()
..
setRectXY
(
rect
,
_kEdgeRadius
,
_kEdgeRadius
);
ui
.
RRect
rrect
=
new
ui
.
RRect
.
fromRectXY
(
rect
,
_kEdgeRadius
,
_kEdgeRadius
);
// Outline of the empty rrect
paint
.
style
=
ui
.
PaintingStyle
.
stroke
;
...
...
packages/flutter/lib/src/material/switch.dart
View file @
bf74bac5
...
...
@@ -124,8 +124,8 @@ class _RenderSwitch extends RenderToggleable {
Rect
rect
=
new
Rect
.
fromLTWH
(
offset
.
dx
,
offset
.
dy
+
_kSwitchHeight
/
2.0
-
_kTrackHeight
/
2.0
,
_kTrackWidth
,
_kTrackHeight
);
ui
.
RRect
rrect
=
new
ui
.
RRect
()
..
setRectXY
(
rect
,
_kTrackRadius
,
_kTrackRadius
);
ui
.
RRect
rrect
=
new
ui
.
RRect
.
fromRectXY
(
rect
,
_kTrackRadius
,
_kTrackRadius
);
canvas
.
drawRRect
(
rrect
,
paint
);
if
(
_radialReaction
!=
null
)
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
bf74bac5
...
...
@@ -949,7 +949,7 @@ class BoxPainter {
canvas
.
drawRect
(
rect
,
_backgroundPaint
);
}
else
{
double
radius
=
_getEffectiveBorderRadius
(
rect
);
canvas
.
drawRRect
(
new
ui
.
RRect
()..
set
RectXY
(
rect
,
radius
,
radius
),
_backgroundPaint
);
canvas
.
drawRRect
(
new
ui
.
RRect
.
from
RectXY
(
rect
,
radius
,
radius
),
_backgroundPaint
);
}
break
;
}
...
...
@@ -1043,8 +1043,8 @@ class BoxPainter {
double
width
=
_decoration
.
border
.
top
.
width
;
double
radius
=
_getEffectiveBorderRadius
(
rect
);
ui
.
RRect
outer
=
new
ui
.
RRect
()..
set
RectXY
(
rect
,
radius
,
radius
);
ui
.
RRect
inner
=
new
ui
.
RRect
()..
set
RectXY
(
rect
.
deflate
(
width
),
radius
-
width
,
radius
-
width
);
ui
.
RRect
outer
=
new
ui
.
RRect
.
from
RectXY
(
rect
,
radius
,
radius
);
ui
.
RRect
inner
=
new
ui
.
RRect
.
from
RectXY
(
rect
.
deflate
(
width
),
radius
-
width
,
radius
-
width
);
canvas
.
drawDRRect
(
outer
,
inner
,
new
Paint
()..
color
=
color
);
}
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
bf74bac5
...
...
@@ -587,7 +587,7 @@ class RenderClipRRect extends RenderProxyBox {
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
if
(
child
!=
null
)
{
Rect
rect
=
offset
&
size
;
ui
.
RRect
rrect
=
new
ui
.
RRect
()..
set
RectXY
(
rect
,
xRadius
,
yRadius
);
ui
.
RRect
rrect
=
new
ui
.
RRect
.
from
RectXY
(
rect
,
xRadius
,
yRadius
);
context
.
paintChildWithClipRRect
(
child
,
offset
.
toPoint
(),
rect
,
rrect
);
}
}
...
...
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