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

Side by Side Diff: Source/devtools/front_end/PieChart.js

Issue 179853002: DevTools: Enable antialiasing in the pie chart. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 this._innerAddSlice(sliceAngle, color); 58 this._innerAddSlice(sliceAngle, color);
59 }, 59 },
60 60
61 /** 61 /**
62 * @param {number} sliceAngle 62 * @param {number} sliceAngle
63 * @param {string} color 63 * @param {string} color
64 */ 64 */
65 _innerAddSlice: function(sliceAngle, color) 65 _innerAddSlice: function(sliceAngle, color)
66 { 66 {
67 var sliceElement = this.element.createChild("div", "pie-chart-slice"); 67 var sliceElement = this.element.createChild("div", "pie-chart-slice");
68 sliceElement.style.webkitTransform = "rotate(" + Number(this._lastAngle) .toFixed(2) + "deg)" 68 // translate3d enables antialiasing for the slice.
pfeldman 2014/02/25 16:19:30 Is there a link to the docs / recommendation for t
69 sliceElement.style.webkitTransform = "translate3d(0, 0, 0) rotate(" + Nu mber(this._lastAngle).toFixed(2) + "deg)"
69 var innerSliceElement = sliceElement.createChild("div", "pie-chart-slice -inner"); 70 var innerSliceElement = sliceElement.createChild("div", "pie-chart-slice -inner");
70 innerSliceElement.style.backgroundColor = color; 71 innerSliceElement.style.backgroundColor = color;
71 innerSliceElement.style.webkitTransform = "rotate(" + Number(sliceAngle) .toFixed(2) + "deg)"; 72 innerSliceElement.style.webkitTransform = "rotate(" + Number(sliceAngle) .toFixed(2) + "deg)";
72 this._lastAngle += sliceAngle; 73 this._lastAngle += sliceAngle;
73 if (this._lastAngle > 360) 74 if (this._lastAngle > 360)
74 console.assert("Pie chard slices are greater than total."); 75 console.assert("Pie chard slices are greater than total.");
75 } 76 }
76 } 77 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698