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
617fa8c3
Commit
617fa8c3
authored
Oct 25, 2016
by
Jason Simmons
Committed by
GitHub
Oct 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Engine roll with updates to the ParagraphBuilder constructor (#6528)
parent
33c65264
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
14 deletions
+14
-14
engine.version
bin/internal/engine.version
+1
-1
hello_world.dart
examples/layers/raw/hello_world.dart
+2
-2
text.dart
examples/layers/raw/text.dart
+2
-2
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+3
-3
editable_line.dart
packages/flutter/lib/src/rendering/editable_line.dart
+2
-2
error.dart
packages/flutter/lib/src/rendering/error.dart
+2
-2
paragraph_builder_test.dart
packages/flutter/test/engine/paragraph_builder_test.dart
+2
-2
No files found.
bin/internal/engine.version
View file @
617fa8c3
a8604ba9d22d22092aa1b245aaf30b11d562b804
9f65114e2061aa2964cc0d2baec8046fc7361ef7
examples/layers/raw/hello_world.dart
View file @
617fa8c3
...
...
@@ -11,9 +11,9 @@ void beginFrame(Duration timeStamp) {
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
final
ui
.
Size
logicalSize
=
ui
.
window
.
physicalSize
/
devicePixelRatio
;
final
ui
.
ParagraphBuilder
paragraphBuilder
=
new
ui
.
ParagraphBuilder
()
final
ui
.
ParagraphBuilder
paragraphBuilder
=
new
ui
.
ParagraphBuilder
(
new
ui
.
ParagraphStyle
()
)
..
addText
(
'Hello, world.'
);
final
ui
.
Paragraph
paragraph
=
paragraphBuilder
.
build
(
new
ui
.
ParagraphStyle
()
)
final
ui
.
Paragraph
paragraph
=
paragraphBuilder
.
build
()
..
layout
(
new
ui
.
ParagraphConstraints
(
width:
logicalSize
.
width
));
final
ui
.
Rect
physicalBounds
=
ui
.
Point
.
origin
&
(
logicalSize
*
devicePixelRatio
);
...
...
examples/layers/raw/text.dart
View file @
617fa8c3
...
...
@@ -52,7 +52,7 @@ void beginFrame(Duration timeStamp) {
void
main
(
)
{
// To create a paragraph of text, we use ParagraphBuilder.
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
()
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
(
new
ui
.
ParagraphStyle
()
)
// We first push a style that turns the text blue.
..
pushStyle
(
new
ui
.
TextStyle
(
color:
const
ui
.
Color
(
0xFF0000FF
)))
..
addText
(
'Hello, '
)
...
...
@@ -74,7 +74,7 @@ void main() {
// which time we can apply styling that affects the entire paragraph, such as
// left, right, or center alignment. Once built, the contents of the paragraph
// cannot be altered, but sizing and positioning information can be updated.
paragraph
=
builder
.
build
(
new
ui
.
ParagraphStyle
()
)
paragraph
=
builder
.
build
()
// Next, we supply a width that the text is permitted to occupy and we ask
// the paragraph to the visual position of each its glyphs as well as its
// overall size, subject to its sizing constraints.
...
...
packages/flutter/lib/src/painting/text_painter.dart
View file @
617fa8c3
...
...
@@ -176,15 +176,15 @@ class TextPainter {
return
;
_needsLayout
=
false
;
if
(
_paragraph
==
null
)
{
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
();
_text
.
build
(
builder
,
textScaleFactor:
textScaleFactor
);
ui
.
ParagraphStyle
paragraphStyle
=
_text
.
style
?.
getParagraphStyle
(
textAlign:
textAlign
,
textScaleFactor:
textScaleFactor
,
ellipsis:
_ellipsis
,
);
paragraphStyle
??=
new
ui
.
ParagraphStyle
();
_paragraph
=
builder
.
build
(
paragraphStyle
);
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
(
paragraphStyle
);
_text
.
build
(
builder
,
textScaleFactor:
textScaleFactor
);
_paragraph
=
builder
.
build
();
}
_lastMinWidth
=
minWidth
;
_lastMaxWidth
=
maxWidth
;
...
...
packages/flutter/lib/src/rendering/editable_line.dart
View file @
617fa8c3
...
...
@@ -216,12 +216,12 @@ class RenderEditable extends RenderBox {
ui
.
Paragraph
_layoutTemplate
;
double
get
_preferredLineHeight
{
if
(
_layoutTemplate
==
null
)
{
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
()
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
(
new
ui
.
ParagraphStyle
()
)
..
pushStyle
(
text
.
style
.
getTextStyle
(
textScaleFactor:
textScaleFactor
))
..
addText
(
_kZeroWidthSpace
);
// TODO(abarth): ParagraphBuilder#build's argument should be optional.
// TODO(abarth): These min/max values should be the default for ui.Paragraph.
_layoutTemplate
=
builder
.
build
(
new
ui
.
ParagraphStyle
()
)
_layoutTemplate
=
builder
.
build
()
..
layout
(
new
ui
.
ParagraphConstraints
(
width:
double
.
INFINITY
));
}
return
_layoutTemplate
.
height
;
...
...
packages/flutter/lib/src/rendering/error.dart
View file @
617fa8c3
...
...
@@ -40,10 +40,10 @@ class RenderErrorBox extends RenderBox {
// Generally, the much better way to draw text in a RenderObject is to
// use the TextPainter class. If you're looking for code to crib from,
// see the paragraph.dart file and the RenderParagraph class.
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
();
ui
.
ParagraphBuilder
builder
=
new
ui
.
ParagraphBuilder
(
paragraphStyle
);
builder
.
pushStyle
(
textStyle
);
builder
.
addText
(
message
);
_paragraph
=
builder
.
build
(
paragraphStyle
);
_paragraph
=
builder
.
build
();
}
}
catch
(
e
)
{
}
}
...
...
packages/flutter/test/engine/paragraph_builder_test.dart
View file @
617fa8c3
...
...
@@ -8,9 +8,9 @@ import 'package:test/test.dart';
void
main
(
)
{
test
(
"Should be able to build and layout a paragraph"
,
()
{
ParagraphBuilder
builder
=
new
ParagraphBuilder
();
ParagraphBuilder
builder
=
new
ParagraphBuilder
(
new
ParagraphStyle
()
);
builder
.
addText
(
'Hello'
);
Paragraph
paragraph
=
builder
.
build
(
new
ParagraphStyle
()
);
Paragraph
paragraph
=
builder
.
build
();
expect
(
paragraph
,
isNotNull
);
paragraph
.
layout
(
new
ParagraphConstraints
(
width:
800.0
));
...
...
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