1
0
mirror of https://github.com/adobe/brackets.git synced 2024-11-20 18:02:54 +01:00

Only fire event when there is an adjustment in font size

This commit is contained in:
Lance Campbell 2014-04-08 08:51:15 -07:00
parent 479ba7b8ef
commit 1547c8b6e5

View File

@ -120,7 +120,10 @@ define(function (require, exports, module) {
delta = /em$/.test(oldFontSize) ? 10 : 1; delta = /em$/.test(oldFontSize) ? 10 : 1;
newFontSize = $(".CodeMirror").css("font-size"); newFontSize = $(".CodeMirror").css("font-size");
adjustment = parseInt((parseFloat(newFontSize) - parseFloat(oldFontSize)) * delta, 10); adjustment = parseInt((parseFloat(newFontSize) - parseFloat(oldFontSize)) * delta, 10);
$(exports).triggerHandler("fontSizeChange", [adjustment, newFontSize]);
if (adjustment) {
$(exports).triggerHandler("fontSizeChange", [adjustment, newFontSize]);
}
// Calculate the new scroll based on the old font sizes and scroll position // Calculate the new scroll based on the old font sizes and scroll position
var newWidth = editor._codeMirror.defaultCharWidth(), var newWidth = editor._codeMirror.defaultCharWidth(),