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

Side by Side Diff: sky/sdk/lib/rendering/paragraph.dart

Issue 1219113003: Make popup menus line up to their baseline per the Material spec. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'box.dart'; 7 import 'box.dart';
8 import 'object.dart'; 8 import 'object.dart';
9 import '../painting/text_style.dart'; 9 import '../painting/text_style.dart';
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 double getMinIntrinsicHeight(BoxConstraints constraints) { 149 double getMinIntrinsicHeight(BoxConstraints constraints) {
150 return _getIntrinsicHeight(constraints); 150 return _getIntrinsicHeight(constraints);
151 } 151 }
152 152
153 double getMaxIntrinsicHeight(BoxConstraints constraints) { 153 double getMaxIntrinsicHeight(BoxConstraints constraints) {
154 return _getIntrinsicHeight(constraints); 154 return _getIntrinsicHeight(constraints);
155 } 155 }
156 156
157 double getDistanceToActualBaseline(TextBaseline baseline) { 157 double computeDistanceToActualBaseline(TextBaseline baseline, RenderObject cli ent) {
158 assert(!needsLayout); 158 assert(!needsLayout);
159 _layout(constraints); 159 _layout(constraints);
160 sky.Element root = _layoutRoot.rootElement; 160 sky.Element root = _layoutRoot.rootElement;
161 switch (baseline) { 161 switch (baseline) {
162 case TextBaseline.alphabetic: return root.alphabeticBaseline; 162 case TextBaseline.alphabetic: return root.alphabeticBaseline;
163 case TextBaseline.ideographic: return root.ideographicBaseline; 163 case TextBaseline.ideographic: return root.ideographicBaseline;
164 } 164 }
165 } 165 }
166 166
167 void performLayout() { 167 void performLayout() {
(...skipping 21 matching lines...) Expand all
189 } 189 }
190 190
191 // we should probably expose a way to do precise (inter-glpyh) hit testing 191 // we should probably expose a way to do precise (inter-glpyh) hit testing
192 192
193 String debugDescribeSettings(String prefix) { 193 String debugDescribeSettings(String prefix) {
194 String result = '${super.debugDescribeSettings(prefix)}'; 194 String result = '${super.debugDescribeSettings(prefix)}';
195 result += '${prefix}inline:\n${inline.toString("$prefix ")}\n'; 195 result += '${prefix}inline:\n${inline.toString("$prefix ")}\n';
196 return result; 196 return result;
197 } 197 }
198 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698