mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
polyfill tripRight for IE11. fix #783
This commit is contained in:
@@ -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`.
|
||||
|
2
konva.min.js
vendored
2
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
|
Reference in New Issue
Block a user