Avoid polling for font size changes every 500ms
This commit is contained in:
parent
7c92d113b2
commit
c50a765176
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
/* vim:ts=4:sts=4:sw=4:
|
/* vim:ts=4:sts=4:sw=4:
|
||||||
|
*
|
||||||
* ***** BEGIN LICENSE BLOCK *****
|
* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
|
|
@ -77,13 +78,13 @@ var Text = function(parentEl) {
|
||||||
|
|
||||||
this.$pollSizeChanges = function() {
|
this.$pollSizeChanges = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
setInterval(function() {
|
//setInterval(function() {
|
||||||
var size = self.$measureSizes();
|
var size = self.$measureSizes();
|
||||||
if (self.$characterSize.width !== size.width || self.$characterSize.height !== size.height) {
|
if (self.$characterSize.width !== size.width || self.$characterSize.height !== size.height) {
|
||||||
self.$characterSize = size;
|
self.$characterSize = size;
|
||||||
self._dispatchEvent("changeCharaterSize", {data: size});
|
self._dispatchEvent("changeCharaterSize", {data: size});
|
||||||
}
|
}
|
||||||
}, 500);
|
//}, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$fontStyles = {
|
this.$fontStyles = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue