Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fabric.StaticCanvas): error of changing read-only style field #7462

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/static_canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
* The transformation (a Canvas 2D API transform matrix) which focuses the viewport
* @type Array
* @example <caption>Default transform</caption>
* canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
* canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
* @example <caption>Scale by 70% and translate toward bottom-right by 50, without skewing</caption>
* canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
* canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
* @default
*/
viewportTransform: fabric.iMatrix.concat(),
Expand Down Expand Up @@ -1776,7 +1776,7 @@
this.contextContainer = null;
// restore canvas style
this.lowerCanvasEl.classList.remove('lower-canvas');
this.lowerCanvasEl.style = this._originalCanvasStyle;
fabric.util.setStyle(this.lowerCanvasEl, this._originalCanvasStyle);
delete this._originalCanvasStyle;
// restore canvas size to original size in case retina scaling was applied
this.lowerCanvasEl.setAttribute('width', this.width);
Expand Down