Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: samples/swarm/swarm_ui_lib/view/MeasureText.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/swarm/swarm_ui_lib/view/CompositeView.dart ('k') | samples/swarm/swarm_ui_lib/view/view.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/swarm_ui_lib/view/MeasureText.dart
diff --git a/samples/swarm/swarm_ui_lib/view/MeasureText.dart b/samples/swarm/swarm_ui_lib/view/MeasureText.dart
index 0f0618589f67b6a1ac9447ea906ae92eff0911fe..6002a413dd8c77ba6a855f89646c71df53092cd4 100644
--- a/samples/swarm/swarm_ui_lib/view/MeasureText.dart
+++ b/samples/swarm/swarm_ui_lib/view/MeasureText.dart
@@ -18,11 +18,11 @@ class MeasureText {
static const String ELLIPSIS = '...';
MeasureText(this.font) {
- if (_context === null) {
+ if (_context == null) {
CanvasElement canvas = new Element.tag('canvas');
_context = canvas.getContext('2d');
}
- if (_spaceLength === null) {
+ if (_spaceLength == null) {
_context.font = font;
_spaceLength = _context.measureText(' ').width;
_typicalCharLength = _context.measureText('k').width;
@@ -59,7 +59,7 @@ class MeasureText {
/**
* Add line broken text as html separated by <br> elements.
* Returns the number of lines in the output.
- * This function is safe to call with [:sb === null:] in which case just the
+ * This function is safe to call with [:sb == null:] in which case just the
* line count is returned.
*/
int addLineBrokenText(StringBuffer sb, String text, num lineWidth,
@@ -70,7 +70,7 @@ class MeasureText {
// We can often avoid performing a full line break calculation when only
// the number of lines and not the actual linebreaks is required.
- if (sb === null) {
+ if (sb == null) {
_context.font = font;
int textWidth = _context.measureText(text).width.toInt();
// By the pigeon hole principle, the resulting text will require at least
@@ -99,7 +99,7 @@ class MeasureText {
// the first whitespace character encountered.
end = Math.min(end + 50, text.length);
}
- if (sb !== null) {
+ if (sb != null) {
if (lines > 1) {
sb.add('<br>');
}
@@ -136,7 +136,7 @@ class MeasureText {
// Edge case:
// It could be the very first word we ran into was too long for a
// line in which case we let it have its own line.
- if (lastWordEndIndex !== null) {
+ if (lastWordEndIndex != null) {
lines++;
callback(startIndex, lastWordEndIndex, currentLength - wordLength);
}
@@ -149,7 +149,7 @@ class MeasureText {
lastWordEndIndex = i;
currentLength += _spaceLength;
wordStartIndex = null;
- } else if (wordStartIndex === null && !whitespace) {
+ } else if (wordStartIndex == null && !whitespace) {
wordStartIndex = i;
}
lastWhitespace = whitespace;
« no previous file with comments | « samples/swarm/swarm_ui_lib/view/CompositeView.dart ('k') | samples/swarm/swarm_ui_lib/view/view.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698