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
c9d3217c
Commit
c9d3217c
authored
Mar 17, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Canvas#drawParagraph
We'll eventually remove Paragraph#paint. Fixes #2694
parent
50a249e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
hello_world.dart
examples/layers/raw/hello_world.dart
+1
-1
text.dart
examples/layers/raw/text.dart
+1
-1
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+1
-1
error.dart
packages/flutter/lib/src/rendering/error.dart
+1
-1
No files found.
examples/layers/raw/hello_world.dart
View file @
c9d3217c
...
...
@@ -22,7 +22,7 @@ void beginFrame(Duration timeStamp) {
final
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
final
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
physicalBounds
);
canvas
.
scale
(
devicePixelRatio
,
devicePixelRatio
);
paragraph
.
paint
(
canvas
,
new
ui
.
Offset
(
canvas
.
drawParagraph
(
paragraph
,
new
ui
.
Offset
(
(
logicalSize
.
width
-
paragraph
.
maxIntrinsicWidth
)
/
2.0
,
(
logicalSize
.
height
-
paragraph
.
height
)
/
2.0
));
...
...
examples/layers/raw/text.dart
View file @
c9d3217c
...
...
@@ -21,7 +21,7 @@ ui.Picture paint(ui.Rect paintBounds) {
// The paint method of Pargraph draws the contents of the paragraph unto the
// given canvas.
paragraph
.
paint
(
canvas
,
new
ui
.
Offset
(
paragraph
.
maxWidth
/
-
2.0
,
(
paragraph
.
maxWidth
/
2.0
)
-
125
));
canvas
.
drawParagraph
(
paragraph
,
new
ui
.
Offset
(
paragraph
.
maxWidth
/
-
2.0
,
(
paragraph
.
maxWidth
/
2.0
)
-
125
));
return
recorder
.
endRecording
();
}
...
...
packages/flutter/lib/src/painting/text_painter.dart
View file @
c9d3217c
...
...
@@ -294,7 +294,7 @@ class TextPainter {
/// Paints the text onto the given canvas at the given offset.
void
paint
(
Canvas
canvas
,
Offset
offset
)
{
assert
(!
_needsLayout
&&
"Please call layout() before paint() to position the text before painting it."
is
String
);
_paragraph
.
paint
(
canvas
,
offset
);
canvas
.
drawParagraph
(
_paragraph
,
offset
);
}
Offset
_getOffsetFromUpstream
(
int
offset
,
Rect
caretPrototype
)
{
...
...
packages/flutter/lib/src/rendering/error.dart
View file @
c9d3217c
...
...
@@ -113,7 +113,7 @@ class RenderErrorBox extends RenderBox {
_paragraph
.
maxWidth
=
size
.
width
;
}
_paragraph
.
layout
();
_paragraph
.
paint
(
context
.
canvas
,
offset
);
context
.
canvas
.
drawParagraph
(
_paragraph
,
offset
);
}
}
catch
(
e
)
{
}
}
...
...
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