polyfill tripRight for IE11. fix #783

This commit is contained in:
Anton Lavrenov
2019-11-08 11:45:17 -05:00
parent bb68b3f1a8
commit 61936af059
4 changed files with 62 additions and 1333 deletions

View File

@@ -5,6 +5,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## Not released:
* Allow hitStrokeWidth usage, even if a shape has not stroke visible
* Better IE11 support
## 4.0.16 - 2019-10-21
* Warn on undefined return value of `dragBoundFunc`.

1383
konva.js

File diff suppressed because it is too large Load Diff

2
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -94,6 +94,11 @@ function checkDefaultFill(config) {
return config;
}
// polyfill for IE11
const trimRight = String.prototype.trimRight || function polyfill() {
return this.replace(/[\s\xa0]+$/, '');
}
/**
* Text constructor
* @constructor
@@ -461,7 +466,7 @@ export class Text extends Shape<TextConfig> {
}
}
// if (align === 'right') {
match = match.trimRight();
match = trimRight.call(match);
// }
this._addTextLine(match);
textWidth = Math.max(textWidth, matchWidth);