| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 this._dummyElement.style.visibility = "hidden"; | 94 this._dummyElement.style.visibility = "hidden"; |
| 95 this._dummyElement.style.zIndex = "-1"; | 95 this._dummyElement.style.zIndex = "-1"; |
| 96 this._dummyElement.style.display = "inline"; | 96 this._dummyElement.style.display = "inline"; |
| 97 this._dummyElement.style.position = "absolute"; | 97 this._dummyElement.style.position = "absolute"; |
| 98 this._dummyElement.style.setProperty("font-family", uniqueFontName); | 98 this._dummyElement.style.setProperty("font-family", uniqueFontName); |
| 99 this._dummyElement.style.setProperty("font-size", WebInspector.FontView.
_measureFontSize + "px"); | 99 this._dummyElement.style.setProperty("font-size", WebInspector.FontView.
_measureFontSize + "px"); |
| 100 | 100 |
| 101 this.element.appendChild(this.fontPreviewElement); | 101 this.element.appendChild(this.fontPreviewElement); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 /** |
| 105 * @override |
| 106 */ |
| 104 wasShown: function() | 107 wasShown: function() |
| 105 { | 108 { |
| 106 this._createContentIfNeeded(); | 109 this._createContentIfNeeded(); |
| 107 | 110 |
| 108 this.updateFontPreviewSize(); | 111 this.updateFontPreviewSize(); |
| 109 }, | 112 }, |
| 110 | 113 |
| 114 /** |
| 115 * @override |
| 116 */ |
| 111 onResize: function() | 117 onResize: function() |
| 112 { | 118 { |
| 113 if (this._inResize) | 119 if (this._inResize) |
| 114 return; | 120 return; |
| 115 | 121 |
| 116 this._inResize = true; | 122 this._inResize = true; |
| 117 try { | 123 try { |
| 118 this.updateFontPreviewSize(); | 124 this.updateFontPreviewSize(); |
| 119 } finally { | 125 } finally { |
| 120 delete this._inResize; | 126 delete this._inResize; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 158 |
| 153 var widthRatio = containerWidth / width; | 159 var widthRatio = containerWidth / width; |
| 154 var heightRatio = containerHeight / height; | 160 var heightRatio = containerHeight / height; |
| 155 var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize *
Math.min(widthRatio, heightRatio)) - 2; | 161 var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize *
Math.min(widthRatio, heightRatio)) - 2; |
| 156 | 162 |
| 157 this.fontPreviewElement.style.setProperty("font-size", finalFontSize + "
px", null); | 163 this.fontPreviewElement.style.setProperty("font-size", finalFontSize + "
px", null); |
| 158 }, | 164 }, |
| 159 | 165 |
| 160 __proto__: WebInspector.SimpleView.prototype | 166 __proto__: WebInspector.SimpleView.prototype |
| 161 }; | 167 }; |
| OLD | NEW |