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

Side by Side Diff: samples/logo/logo.dart

Issue 10982002: Fixing creating SVG elements with trailing newlines. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « lib/html/src/shared_FactoryProviders.dart ('k') | tests/html/svg_1_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:html'; 5 import 'dart:html';
6 import 'dart:math' as Math; 6 import 'dart:math' as Math;
7 7
8 class Color { 8 class Color {
9 int hue; 9 int hue;
10 double saturation; 10 double saturation;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 void main() { 136 void main() {
137 defaultColors = {}; 137 defaultColors = {};
138 138
139 logo = new SVGElement.svg(""" 139 logo = new SVGElement.svg("""
140 <svg xmlns="http://www.w3.org/2000/svg" 140 <svg xmlns="http://www.w3.org/2000/svg"
141 version="1.1" 141 version="1.1"
142 width="371.6655" 142 width="371.6655"
143 height="374.14087"> 143 height="374.14087">
144 <filter id="inverse"> 144 <filter id="inverse">
145 <feComponentTransfer> 145 <feComponentTransfer>
146 <feFuncR type="table" tableValues="1 0"/> 146 <feFuncR type="table" tableValues="1 0"/>
147 <feFuncG type="table" tableValues="1 0"/> 147 <feFuncG type="table" tableValues="1 0"/>
148 <feFuncB type="table" tableValues="1 0"/> 148 <feFuncB type="table" tableValues="1 0"/>
149 </feComponentTransfer> 149 </feComponentTransfer>
150 </filter> 150 </filter>
151 <path 151 <path
152 d="m 101.86949,101.86487 -24.192001,-24.192004 0.088,174.807994 0.296,8.164 c 0.12,3.848 0.84,8.18 2.012,12.684 l 191.615991,67.55601 47.89201,-21.216 0.01 6,-0.056 -217.728,-217.748 z" 152 d="m 101.86949,101.86487 -24.192001,-24.192004 0.088,174.807994 0.296,8.164 c 0.12,3.848 0.84,8.18 2.012,12.684 l 191.615991,67.55601 47.89201,-21.216 0.01 6,-0.056 -217.728,-217.748 z"
153 id="path2900" 153 id="path2900"
154 style="fill: #31beb2" /> 154 style="fill: #31beb2" />
155 <path 155 <path
156 d="m 80.073489,273.32486 0.02,0.008 c -0.02,-0.084 -0.052,-0.168 -0.076,-0. 252 0.028,0.084 0.036,0.16 0.056,0.244 z m 239.524001,46.28401 m -0.016,0.056 -4 7.89201,21.216 -191.591991,-67.54801 c 3.656,14.044 11.764,29.83201 20.476001,38 .45601 l 62.52,62.172 139.052,0.18 17.452,-54.532 -0.016,0.056 z" 156 d="m 80.073489,273.32486 0.02,0.008 c -0.02,-0.084 -0.052,-0.168 -0.076,-0. 252 0.028,0.084 0.036,0.16 0.056,0.244 z m 239.524001,46.28401 m -0.016,0.056 -4 7.89201,21.216 -191.591991,-67.54801 c 3.656,14.044 11.764,29.83201 20.476001,38 .45601 l 62.52,62.172 139.052,0.18 17.452,-54.532 -0.016,0.056 z"
157 id="path2902" 157 id="path2902"
158 style="fill: #75ccc3" /> 158 style="fill: #75ccc3" />
159 <path 159 <path
160 d="M 77.673489,77.668866 3.1974828,190.16487 c -6.192,6.616 -3.11599997,20. 244 6.8520002,30.276 l 42.996005,43.35199 27.028001,9.528 c -1.172,-4.504 -1.892 ,-8.832 -2.012,-12.684 l -0.296,-8.164 -0.092,-174.803994 0,0 z" 160 d="M 77.673489,77.668866 3.1974828,190.16487 c -6.192,6.616 -3.11599997,20. 244 6.8520002,30.276 l 42.996005,43.35199 27.028001,9.528 c -1.172,-4.504 -1.892 ,-8.832 -2.012,-12.684 l -0.296,-8.164 -0.092,-174.803994 0,0 z"
161 id="path2904" 161 id="path2904"
162 style="fill: #008bc9" /> 162 style="fill: #008bc9" />
163 <path 163 <path
164 d="m 273.26148,79.920866 c -4.48,-1.148 -8.808,-1.856 -12.708,-1.98 l -8.64 ,-0.308 -174.239991,0.036 241.960001,241.940004 0.02,-0.008 21.24,-47.93601 -67. 63201,-191.743994 z" 164 d="m 273.26148,79.920866 c -4.48,-1.148 -8.808,-1.856 -12.708,-1.98 l -8.64 ,-0.308 -174.239991,0.036 241.960001,241.940004 0.02,-0.008 21.24,-47.93601 -67. 63201,-191.743994 z"
165 id="path2906" 165 id="path2906"
166 style="fill: #0082c4" /> 166 style="fill: #0082c4" />
167 <path 167 <path
168 d="m 273.04948,79.876866 c 0.072,0.02 0.148,0.044 0.22,0.064 l -0.004,-0.02 c -0.076,-0.02 -0.144,-0.024 -0.216,-0.044 z m 38.66001,20.576004 c -8.792,-8.8 60004 -24.37601,-16.912004 -38.44001,-20.512004 l 67.62801,191.727994 -21.24,47. 93601 -0.02,0.008 51.928,-16.592 0.1,-142.368 -59.956,-60.2 z" 168 d="m 273.04948,79.876866 c 0.072,0.02 0.148,0.044 0.22,0.064 l -0.004,-0.02 c -0.076,-0.02 -0.144,-0.024 -0.216,-0.044 z m 38.66001,20.576004 c -8.792,-8.8 60004 -24.37601,-16.912004 -38.44001,-20.512004 l 67.62801,191.727994 -21.24,47. 93601 -0.02,0.008 51.928,-16.592 0.1,-142.368 -59.956,-60.2 z"
169 id="path2908" 169 id="path2908"
170 style="fill: #008bc9" /> 170 style="fill: #008bc9" />
171 <path 171 <path
172 d="M 263.78548,53.048866 220.45349,10.028873 c -10.02,-9.92799955 -23.664,- 13.0239996 -30.26,-6.8439996 L 77.677489,77.672866 l 174.239991,-0.036 8.64,0.30 8 c 3.9,0.124 8.228,0.832 12.708,1.98 l -9.48,-26.876 z m -186.111991,24.62" 172 d="M 263.78548,53.048866 220.45349,10.028873 c -10.02,-9.92799955 -23.664,- 13.0239996 -30.26,-6.8439996 L 77.677489,77.672866 l 174.239991,-0.036 8.64,0.30 8 c 3.9,0.124 8.228,0.832 12.708,1.98 l -9.48,-26.876 z m -186.111991,24.62"
173 id="path2910" 173 id="path2910"
174 style="fill: #75ccc3" /> 174 style="fill: #75ccc3" />
175 </svg>"""); // TOOD(dgrove) - add newline back when issue 3846 fixed. 175 </svg>
176 """);
176 177
177 query("#icon").elements.add(logo); 178 query("#icon").elements.add(logo);
178 logo.queryAll("path").forEach((p) { 179 logo.queryAll("path").forEach((p) {
179 defaultColors[p.id] = new Color.hex(p.style.getPropertyValue('fill')); 180 defaultColors[p.id] = new Color.hex(p.style.getPropertyValue('fill'));
180 }); 181 });
181 182
182 hue = document.query("input[name=hue]"); 183 hue = document.query("input[name=hue]");
183 hue.on.change.add(onSliderChange); 184 hue.on.change.add(onSliderChange);
184 saturation = document.query("input[name=saturation]"); 185 saturation = document.query("input[name=saturation]");
185 saturation.on.change.add(onSliderChange); 186 saturation.on.change.add(onSliderChange);
186 lightness = document.query("input[name=lightness]"); 187 lightness = document.query("input[name=lightness]");
187 lightness.on.change.add(onSliderChange); 188 lightness.on.change.add(onSliderChange);
188 189
189 document.query("input[name=invert]").on.change.add((Event e) { 190 document.query("input[name=invert]").on.change.add((Event e) {
190 InputElement invert = e.target; 191 InputElement invert = e.target;
191 if (invert.checked) { 192 if (invert.checked) {
192 logo.classes = ['inverse']; 193 logo.classes = ['inverse'];
193 } else { 194 } else {
194 logo.classes = []; 195 logo.classes = [];
195 } 196 }
196 }); 197 });
197 } 198 }
OLDNEW
« no previous file with comments | « lib/html/src/shared_FactoryProviders.dart ('k') | tests/html/svg_1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698