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
c464b82f
Commit
c464b82f
authored
Jul 31, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #419 from abarth/fix_align_right
Fix TextAlign.right
parents
cb9376cb
2b0e4784
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
text_style.dart
packages/flutter/lib/painting/text_style.dart
+10
-7
paragraph.dart
packages/flutter/lib/rendering/paragraph.dart
+9
-0
No files found.
packages/flutter/lib/painting/text_style.dart
View file @
c464b82f
...
@@ -140,6 +140,16 @@ class TextStyle {
...
@@ -140,6 +140,16 @@ class TextStyle {
FontWeight
.
w900
:
'900'
FontWeight
.
w900
:
'900'
}[
fontWeight
];
}[
fontWeight
];
}
}
if
(
decoration
!=
null
)
{
cssStyle
[
'text-decoration'
]
=
_decorationToCSSString
(
decoration
);
if
(
decorationColor
!=
null
)
cssStyle
[
'text-decoration-color'
]
=
_colorToCSSString
(
decorationColor
);
if
(
decorationStyle
!=
null
)
cssStyle
[
'text-decoration-style'
]
=
_decorationStyleToCSSString
(
decorationStyle
);
}
}
void
applyToContainerCSSStyle
(
CSSStyleDeclaration
cssStyle
)
{
if
(
textAlign
!=
null
)
{
if
(
textAlign
!=
null
)
{
cssStyle
[
'text-align'
]
=
const
{
cssStyle
[
'text-align'
]
=
const
{
TextAlign
.
left
:
'left'
,
TextAlign
.
left
:
'left'
,
...
@@ -150,13 +160,6 @@ class TextStyle {
...
@@ -150,13 +160,6 @@ class TextStyle {
if
(
height
!=
null
)
{
if
(
height
!=
null
)
{
cssStyle
[
'line-height'
]
=
'
${height}
'
;
cssStyle
[
'line-height'
]
=
'
${height}
'
;
}
}
if
(
decoration
!=
null
)
{
cssStyle
[
'text-decoration'
]
=
_decorationToCSSString
(
decoration
);
if
(
decorationColor
!=
null
)
cssStyle
[
'text-decoration-color'
]
=
_colorToCSSString
(
decorationColor
);
if
(
decorationStyle
!=
null
)
cssStyle
[
'text-decoration-style'
]
=
_decorationStyleToCSSString
(
decorationStyle
);
}
}
}
bool
operator
==(
other
)
{
bool
operator
==(
other
)
{
...
...
packages/flutter/lib/rendering/paragraph.dart
View file @
c464b82f
...
@@ -11,6 +11,9 @@ import 'package:sky/rendering/object.dart';
...
@@ -11,6 +11,9 @@ import 'package:sky/rendering/object.dart';
abstract
class
InlineBase
{
abstract
class
InlineBase
{
sky
.
Node
_toDOM
(
sky
.
Document
owner
);
sky
.
Node
_toDOM
(
sky
.
Document
owner
);
String
toString
([
String
prefix
=
''
]);
String
toString
([
String
prefix
=
''
]);
void
_applyStyleToContainer
(
sky
.
Element
container
)
{
}
}
}
class
InlineText
extends
InlineBase
{
class
InlineText
extends
InlineBase
{
...
@@ -48,6 +51,10 @@ class InlineStyle extends InlineBase {
...
@@ -48,6 +51,10 @@ class InlineStyle extends InlineBase {
return
parent
;
return
parent
;
}
}
void
_applyStyleToContainer
(
sky
.
Element
container
)
{
style
.
applyToContainerCSSStyle
(
container
.
style
);
}
bool
operator
==(
other
)
{
bool
operator
==(
other
)
{
if
(
identical
(
this
,
other
))
if
(
identical
(
this
,
other
))
return
true
;
return
true
;
...
@@ -112,6 +119,8 @@ class RenderParagraph extends RenderBox {
...
@@ -112,6 +119,8 @@ class RenderParagraph extends RenderBox {
return
;
return
;
_inline
=
value
;
_inline
=
value
;
_layoutRoot
.
rootElement
.
setChild
(
_inline
.
_toDOM
(
_document
));
_layoutRoot
.
rootElement
.
setChild
(
_inline
.
_toDOM
(
_document
));
_layoutRoot
.
rootElement
.
removeAttribute
(
'style'
);
_inline
.
_applyStyleToContainer
(
_layoutRoot
.
rootElement
);
_constraintsForCurrentLayout
=
null
;
_constraintsForCurrentLayout
=
null
;
markNeedsLayout
();
markNeedsLayout
();
}
}
...
...
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